Show a DIV on hover
I'm trying to build a menu that opens another div when you hover an item. It works in Firefox, but since IE will only allow links to have :hover it will not work. I have some java that lets you trick IE into displaying a list on hover, but I have yet to figure out how to change it to work with a div.
Here is a link to the page
Thanks in Advance,
what you basically need is to capture an event which in turn call a function to deal with displaying the content, in this case, for msie/win. that is, you need to register the event onmouseover and onmouseout on each DIV that will act as menu. the function will contain code that work with the css properties as disiplay.
sorry i can't provide a code because has not been coding for months and now i have to reread some technical things.
the simplest way is to duplicate the CSS in div:hover with a custom class, .hover
then, you can simply change the class to hover upon over, and blank upon "unhover".
you could screen out non-ie browsers in a conditional right before the this.className, but the duplicate CSS should appear the same as the proper :hover code anyway...
<div onmouseover="this.className='hover';" onmouseout="this.className='';" >
An .htc file is another way of doing it. It's my preferred way because you can leave the HTML alone.
Great wit and madness are near allied, and fine a line their bounds divide.
I just posted about this in response to several similar "tool-tip" like questions. As far as I know, the solution(s) were appreciated. Here's one of them: http://www.webdeveloper.com/forum/sh...php?t=191144#3
Will that accomplish what you need? Would you like a sample page?
could u provide me the code for that..
Originally Posted by rnd me
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)