473,661 Members | 2,421 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 4640
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
2000
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 C:\Inetpub\wwwroot\programs\index.php on line 8 Now, I def know I've configured my php.ini correctly (its literally the same as my XP machine) and I know that mysql works fine with PHP as I can run it from the command line :D I've got the files (tried in multiple places - but...
4
21667
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 type="text/javascript"> function getcoords() { document.getElementById("coord-x").value = event.clientX + ""; document.getElementById("coord-y").value = event.clientY + "";
1
2115
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 and tried to populate dataset but it populates 0 rows even though ml contains rows. If i use regular Dataset instead of Typed dataset, then everything works just fine..please help me as soon as possible, here is my code snippet. I think you have...
4
2001
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 to another page....PRINTING Hello:- John .. for example It says ERROR:- System.IndexOutOfRangeException: username.Text What does this mean and how can i correct it PLS HELP!!
4
2144
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 stack { public:
5
1421
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 understand what im doing wrong ? (below the following code is also the errors i get) THX in advance } static { Property.set ((class$com$maddox$il2$objects$air$CockpitB29_TGunner == null ?...
3
2838
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 me out I would be grateful. Two of the questions are below, if anyone can help with these two I'm sure that I can crack the rest! Find the first name, surnames and address of the patients that have had at least one operation with broken bones. ...
2
1112
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 trying to display the value of a certain cell in a label control. Say, NewsId for my example. In this example, NewsId should be 14. I took this line and used it to find out how many rows there were: DateConfirmLabel.Text =...
0
8428
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8341
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8542
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2760
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 we have to send another system
2
1984
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.