473,508 Members | 2,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

clientX & clientY with IE7 - I can't go sideways!! Help?

25 New Member
Hello -
Yes - I know floating/persistent layers can be yucky - but for this project it is only tiny and contains some xy mouse coordinates for a map...
buy anyway - here's my problem:

I have a javascript that keeps the layer persistent for the HEIGHT, but not WIDTH in IE7.
Of course it works great in the other browsers... Can anyone see what is wrong with the script? Any help would be so good - I have tried everything my limited knowledge will allow!

Expand|Select|Wrap|Line Numbers
  1. <!--Here is where Part the XY Script starts-->
  2. <div id="divBottomLeft"  style="position:absolute">
  3.  
  4. <!--        MY Layer contents          -->
  5.  
  6. </div>
  7.  
  8. <!--Below is the troublesome floating layer script-->
  9.  
  10. <script type="text/javascript">
  11. var ns = (navigator.appName.indexOf("Netscape") != -1);
  12. var d = document;
  13. var px = document.layers ? "" : "px";
  14. function JSFX_FloatDiv(id, sx, sy)
  15. {
  16.     var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  17.     window[id + "_obj"] = el;
  18.     if(d.layers)el.style=el;
  19.     el.cx = el.sx = sx;el.cy = el.sy = sy;
  20.     el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px; this.style.right=y+px; this.style.bottom=y+px;};
  21.     el.flt=function()
  22.     {
  23.         var pX, pY;
  24.         pX = ns ? pageXOffset : document.documentElement && document.documentElement.scrollLeft ? 
  25.         document.documentElement.scrollLeft : document.body.scrollLeft;
  26.         if(this.sx<0) 
  27.         pX += ns ? innerWidth : document.documentElement && document.documentElement.clientX ? 
  28.         document.documentElement.clientX : document.body.clientX;
  29.         pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
  30.         document.documentElement.scrollTop : document.body.scrollTop;
  31.         if(this.sy<0) 
  32.         pY += ns ? innerHeight : document.documentElement && document.documentElement.clientY ? 
  33.         document.documentElement.clientY : document.body.clientY;
  34.         this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
  35.         this.sP(this.cx, this.cy);
  36.         setTimeout(this.id + "_obj.flt()", 40);
  37.     }
  38.     return el;
  39. }
  40.  
  41. JSFX_FloatDiv("divBottomLeft",    5, -40).flt();
  42.  
  43.  
  44. </script>
  45.  
Mar 21 '07 #1
3 4629
Head In A Pan
25 New Member
Oops! Still buggered but have changed clientX etc to clientWidth etc
so now it's:

Expand|Select|Wrap|Line Numbers
  1. <!--Here is where Part the XY Script starts-->
  2. <div id="divBottomLeft"  style="position:absolute">
  3. <form name=ee><input name=sd type=text style="color: white; background-color: #706d66" size="8"> 
  4. </input>
  5. </form>
  6.  
  7. <!--        My layer content          -->
  8. </div>
  9.  
  10.  
  11.  
  12. <!--Below is the floating layer script-->
  13.  
  14. <script type="text/javascript">
  15. var ns = (navigator.appName.indexOf("Netscape") != -1);
  16. var d = document;
  17. var px = document.layers ? "" : "px";
  18. function JSFX_FloatDiv(id, sx, sy)
  19. {
  20.     var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
  21.     window[id + "_obj"] = el;
  22.     if(d.layers)el.style=el;
  23.     el.cx = el.sx = sx;el.cy = el.sy = sy;
  24.     el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px; this.style.right=y+px; this.style.bottom=y+px;};
  25.     el.flt=function()
  26.     {
  27.         var pX, pY;
  28.         pX = ns ? pageXOffset : document.documentElement && document.documentElement.scrollLeft ? 
  29.         document.documentElement.scrollLeft : document.body.scrollLeft;
  30.         if(this.sx<0) 
  31.         pX += ns ? clientWidth : document.documentElement && document.documentElement.clientWidth ? 
  32.         document.documentElement.clientWidth : document.body.clientWidth;
  33.  
  34.         pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
  35.         document.documentElement.scrollTop : document.body.scrollTop;
  36.         if(this.sy<0) 
  37.         pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
  38.         document.documentElement.clientHeight : document.body.clientHeight;
  39.         this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
  40.         this.sP(this.cx, this.cy);
  41.         setTimeout(this.id + "_obj.flt()", 40);
  42.     }
  43.     return el;
  44. }
  45.  
  46. JSFX_FloatDiv("divBottomLeft",    5, -40).flt();
  47.  
  48.  
  49. </script>
  50.  
Mar 21 '07 #2
acoder
16,027 Recognized Expert Moderator MVP
Does this link help?
Mar 22 '07 #3
Head In A Pan
25 New Member
Does this link help?
Thanks mate -
I'll attempt to fit that function into my code -

I'm just not so clued in with js. I kind of get the concepts (as my actionscripting is coming along nicely... better anyway)
But I'm not absolutely sure how to make this function slot into my (borrowed) code. ;)
Mar 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1992
by: Frobinrobin | last post by:
I am running Win2k3 Server and when I try to use the mysql_connect function I am getting an error: Fatal error: Call to undefined function mysql_connect() in...
4
21648
by: TheKeith | last post by:
Can someone tell me why this isn't working? <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script...
1
2105
by: Linesh Gajera | last post by:
Hi Guys i having the same problem with Strongly typed dataset, I have created a stronsetly typed dataset by draging table from Server explorer and now i have retreived xml from SQL server 2000...
4
1996
by: Patrick.O.Ige | last post by:
I have a code below.(It validates against a SQL DB(login page).thats is giving me an error! When i try to use :- Session = dr.ToString(); To catch the username so as to redirect the user logged in...
4
2136
by: alisaee | last post by:
plz check what i have made wrong what is requierd her is to creat class queue and class stack and run the push,pop operation . #include<iostream.h> #include<conio.h> #include<stdio.h> class...
5
1416
by: PeaceLovinHippy | last post by:
Hello im new to java & im working on some mods for a game - below is a small part which im working on . however im getting errors due to something wrong in the code - can anyone please help me...
3
2828
Metallicat
by: Metallicat | last post by:
I have been posed and attempted to answer several questions but I do not seem to be getting anywhere. I have emailed my tutor a week ago and he has not responded, If anyone can take a look and help...
2
1106
by: Andy B | last post by:
I have a detailsView (replaced the formview with it) thinking it would help me fix my control access in a formview problem. Well, I don't think .net knows how to count. Here is what I have: I am...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7120
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7494
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5626
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1553
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
763
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.