473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

LayerX in IE???

Hi,

I have the following code, which run popup widow. In Mozilla this work OK, I have problems in IE. The popup window appears on the top of my window not near my mouse cursor.

I think I don't use event.offsetX or event.offsetY correctly....



Expand|Select|Wrap|Line Numbers
  1. var tooltip = document.createElement('div'); 
  2.  
  3. document.getElementById("mydiv").appendChild(tooltip);  
  4.  
  5. var ie5 = (document.getElementById && document.all); 
  6. var ns6 = (document.getElementById && !document.all); 
  7.  
  8. if(document.getElementById)
  9. {
  10.  
  11.             mousex = (ie5)?event.offsetX:(ns6)? e.layerX:false;
  12.             mousey = (ie5)?event.offsetY:(ns6)? e.layerY:false; 
  13.  
  14.                 tooltip.style.left =( mousex+12 ) + 'px';
  15.                tooltip.style.top = (mousey+8) + 'px';
  16. }
  17.  
Thanks in advance:)
Feb 16 '07 #1
1 5988
acoder
16,027 Expert Mod 8TB
The correct way to detect mouse co-ordinates is described at the bottom of this page.
Feb 17 '07 #2

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

Similar topics

2
by: optimistx | last post by:
When we click an image, we get the coordinates x and y in the event handler, like this <script type="text/javascript"> function fun2(evnt){ var e=evnt; if (e==undefined){e=event;} var x=e.x...
7
by: Paul Cooper | last post by:
Dear All, I am working on a piece of Javascript code that needs to detect a mouse-click, shift-click and control-click. The code is not my own - it is a part of a much larger suite of routines....
1
by: Bizcatone | last post by:
Hi I am new to JS and want to add some actions to a few images. Can somebody help to complete the codes for me. I need 2 functions: (1) Original small image size, would like to enlarge to...
2
by: Michi | last post by:
Hallo, for hours i'm searching for an solution for the following problem: Inside a container i have some cathegories and in each of them some questions (look at HTML), The questions should be...
4
by: marss | last post by:
Example: <form action="..." method="post"> <input type=image name="Image1" onclick="beforeSubmit();" src="..."/> </form> When I click on the image the form submitted to the server. As I can...
9
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
2
by: Nathan Sokalski | last post by:
I have the following code which allows you to drag a div in IE, and have it then move back to it's natural position when you release the mouse button: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML...
3
kovik
by: kovik | last post by:
Normalizing Event Triggers in JavaScript For those of you who are too lazy to keep up with the standards of the current JavaScript versions, this will suffice: elem.onmouseup = SomeFunction; ...
16
by: Mathieu Maes | last post by:
I have developed a page with javascript which has a filmstrip look- alike bar and a slideshow: http://celtecbe.apache02.hostbasket.com/pdw/media.php?id=268 It uses a "onmousemove" event, which...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.