•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,555 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,473 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 1261 | Replies: 3
![]() |
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I am trying to implement mouse over popUp in my application, that is working fine in Mozilla but not working in IE.
In IE its position is not coming proper and I am not able to shift it.
To set position of popUp I am using following code:
var offX= -180; // how far from mouse to show tip
var offY= 12;
var mouseX, mouseY;
function trackMouse(evt) {
standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
if (tipOn) positionTip(evt);
}
function positionTip(evt) {
if (!tipFollowMouse) {
mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
}
// tooltip width and height
var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
// document area in view (subtract scrollbar width for ns)
var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
// check mouse position against tip and window dimensions
// and position the tooltip
if ((mouseX+offX+tpWd)>winWd)
tipcss.left = mouseX-(tpWd+offX)+"px";
else tipcss.left = mouseX+offX+"px";
if ((mouseY+offY+tpHt)>winHt)
tipcss.top = winHt-(tpHt+offY)+"px";
else tipcss.top = mouseY+offY+"px";
if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}
In popUp there is an init method which is loaded on body using <body onLoad=""> tag.
Tanu
I am trying to implement mouse over popUp in my application, that is working fine in Mozilla but not working in IE.
In IE its position is not coming proper and I am not able to shift it.
To set position of popUp I am using following code:
var offX= -180; // how far from mouse to show tip
var offY= 12;
var mouseX, mouseY;
function trackMouse(evt) {
standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body //create reference to common "body" across doctypes
mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
if (tipOn) positionTip(evt);
}
function positionTip(evt) {
if (!tipFollowMouse) {
mouseX = (ns5)? evt.pageX: window.event.clientX + standardbody.scrollLeft;
mouseY = (ns5)? evt.pageY: window.event.clientY + standardbody.scrollTop;
}
// tooltip width and height
var tpWd = (ie4||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
var tpHt = (ie4||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
// document area in view (subtract scrollbar width for ns)
var winWd = (ns5)? window.innerWidth-20+window.pageXOffset: standardbody.clientWidth+standardbody.scrollLeft;
var winHt = (ns5)? window.innerHeight-20+window.pageYOffset: standardbody.clientHeight+standardbody.scrollTop;
// check mouse position against tip and window dimensions
// and position the tooltip
if ((mouseX+offX+tpWd)>winWd)
tipcss.left = mouseX-(tpWd+offX)+"px";
else tipcss.left = mouseX+offX+"px";
if ((mouseY+offY+tpHt)>winHt)
tipcss.top = winHt-(tpHt+offY)+"px";
else tipcss.top = mouseY+offY+"px";
if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}
In popUp there is an init method which is loaded on body using <body onLoad=""> tag.
Tanu
This is an area where there is much incompatibility.
The values pageX and pageY are part of the Mozilla set of properties, not the W3C standard DOM properties. IE doesn't know them.
Fortunately for me (I hate those popups), but unfortunately for everyone else, there is no agreement between IE and Mozilla here. I don't understand why everyone loves these maddening popup devices. They are NOT dyslexic-accessible.
The W3C standard DOM reports the mouse locations with clientX and clientY. The problem is that these do not take document scrolling into account, but just use the browser window location.
The values pageX and pageY are part of the Mozilla set of properties, not the W3C standard DOM properties. IE doesn't know them.
Fortunately for me (I hate those popups), but unfortunately for everyone else, there is no agreement between IE and Mozilla here. I don't understand why everyone loves these maddening popup devices. They are NOT dyslexic-accessible.
The W3C standard DOM reports the mouse locations with clientX and clientY. The problem is that these do not take document scrolling into account, but just use the browser window location.
Last edited by MidiMagic : Oct 21st, 2007 at 10:12 pm.
Daylight-saving time uses more gasoline
•
•
Join Date: Oct 2007
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi,
I am still stucked with the same problem of different responses in IE and mozilla.
I am trying to popUp a Calender on click and that is working fine in mozilla but in IE that is getting transparent.. like Dropdown boxes from the background are coming over the calendar.
I think I need to set z-index for this.. but I am not able to do.
Please help.. if anybody can.
Thanks.
Tanu
I am still stucked with the same problem of different responses in IE and mozilla.
I am trying to popUp a Calender on click and that is working fine in mozilla but in IE that is getting transparent.. like Dropdown boxes from the background are coming over the calendar.
I think I need to set z-index for this.. but I am not able to do.
Please help.. if anybody can.
Thanks.
Tanu
The Z index is also not totally implemented yet in a universal way that works on all browsers.
You need to either open an entirely new window (taking focus away from the stuff on the existing window) or make sure where you open the popup has no links under it.
You need to either open an entirely new window (taking focus away from the stuff on the existing window) or make sure where you open the popup has no links under it.
Daylight-saving time uses more gasoline
![]() |
•
•
•
•
•
•
•
•
DaniWeb JavaScript / DHTML / AJAX Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Installing Windows 98 On VMware. Floppy problem (Windows 9x / Me)
- Windows XP keeps restarting since a new video card (Windows NT / 2000 / XP / 2003)
- Redhat Linux 6.2 - ipop3d problem? (*nix Software)
- Problem with T720 (Gadgets and Gizmos)
- Connection Problems (Networking Hardware Configuration)
- Encoding (Unicode) problem in IE 6.0 (Web Browsers)
- .htaccess mod_rewrite problem (Linux Servers and Apache)
- Javascript/HTML problem!!! (JavaScript / DHTML / AJAX)
- Problem with Windows Update and WinXP (Web Browsers)
Other Threads in the JavaScript / DHTML / AJAX Forum
- Previous Thread: Error: Expected ')'
- Next Thread: List problem in firefox



Linear Mode