473,385 Members | 1,615 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,385 software developers and data experts.

Hovers/Mouseovers

I got my problem from yesterday fixed. Looks like when you mouseover a link it will now bring up a preview of the article. My problem is now this, in IE the preview stays put and you can move your mouse to the bottom the the preview to read the whole article. In FF although it pulls up the preview it moves it all over the screen and you can not move your mouse into the preview to click "read more". Please help.

Expand|Select|Wrap|Line Numbers
  1. var IE = document.all?true:false;
  2. document.onmousemove=mousemove;
  3.  
  4. var tempX = 0;
  5. var tempY = 0;
  6.  
  7. function mousemove(e) {
  8.     if(!IE) {
  9.             tempX = e.pageX;
  10.             tempY = e.pageY;    
  11.         }
  12.  
  13.     return false;
  14. }
  15.  
  16.  
  17.  
  18.  
  19. function getMouseXY(e) {
  20.    tempX = event.clientX + document.documentElement.scrollLeft;
  21.    tempY = event.clientY + document.documentElement.scrollTop;
  22.    return true;
  23. }
  24.  
  25.  
  26. function funcshowdiv(divname, moveYN)
  27. {    
  28.  
  29. if(IE) {getMouseXY();}
  30.  
  31.  
  32. //alert('x: ' + tempX + ' y: ' + tempY);
  33.  
  34. if (tempX < 0){tempX = 0;}
  35. if (tempY < 0){tempY = 0;} 
  36. tempX = tempX - 10;
  37. tempY = tempY - 10;
  38.  
  39.  
  40.     if(IE){
  41.         var obj;
  42.         obj = eval('document.all.' + divname)
  43.         obj.style.display= ''; 
  44.         if (moveYN)
  45.         {
  46.             obj.style.top = tempY + 'px';
  47.             obj.style.left = tempX + 'px';
  48.         }
  49.     } else {
  50.         if(document.getElementById(divname).style.display!= ''){ 
  51.         document.getElementById(divname).style.display= ''; 
  52.         document.getElementById(divname).style.left= tempX + 'px';
  53.         document.getElementById(divname).style.top= tempY + 'px';
  54.     }
  55.     }   
  56.  
  57.  
  58. }
  59.  
  60.  
  61.  
  62. function funchidediv(divname, moveYN)
  63. {
  64.     if(document.layers) 
  65.     { // browser="NN4"; 
  66.     document.layers[divname].display= 'none'; 
  67.     } 
  68.     if(document.all) { // browser="IE"; 
  69.     var obj;
  70.     obj = eval('document.all.' + divname)
  71.     obj.style.display= 'none'; 
  72.  
  73.     } 
  74.     if(!document.all && document.getElementById){ // browser="NN6+ or IE5+ if you're willing to dump the !document.all stuff"; 
  75.     document.getElementById(divname).style.display= 'none'; 
  76.     }   
  77.  
  78. }
  79.  
Feb 7 '07 #1
1 1050
acoder
16,027 Expert Mod 8TB
This is old code. There's no need to use document.all and document.layers. Just use the standard document.getElementById, unless you want to support old buggy browsers. See this link for some help.
Feb 8 '07 #2

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

Similar topics

2
by: bsanderson | last post by:
I am trying to build the same text link mouseover as yahoo has on each news item. when you hover over the link, a small box pops up and displays a photo wtih text. I can get the box to pop up,...
4
by: Just Me | last post by:
I want to make a small window popup when the mouse hovers. I've looked in the Help but can't find any info (probably can't think of a good keyword) Are ToolTips control used for that? Any...
0
by: mgalloway | last post by:
I got my problem from yesterday fixed. Looks like when you mouseover a link it will now bring up a preview of the article. My problem is now this, in IE the preview stays put and you can move your...
1
by: Bart Lateur | last post by:
I'd like to replace the text content of a subdiv by "...", except when the mouse is hovering either above it, or above another subdiv of the same parent. Something like: <div class="parent">...
4
by: alice | last post by:
I'm trying to get sounds to play on image mouseovers using dreamweaver 8, and I found out that the code it generates to do this only works for IE. Is there a way to do this so that it will work...
5
by: ramadeviirrigireddy | last post by:
Hi All, I'm new to this group. I'm working on Java/J2ee. In my project i have one bricklet with header it will have some default color.But when mouseovers on this header i need to change the...
5
by: kimiraikkonen | last post by:
Hi, I couldn't find a necessary class which shows when mouse hovers on a link in Webbrowser control. Think of there's a status bar(text), when mouse comes on a link, the URL must be shown in...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.