Log in

View Full Version : IE 6 Hover Display



Titan85
01-18-2007, 01:05 AM
I have been trying lots of things to get IE 6 to display a different background color when the on mouse over, but have been unsuccessful. Does anyone know how I can get the effect of .divname:hover { to work in IE 6?

djr33
01-18-2007, 01:14 AM
From glancing at posts as they've gone by, I believe that the pseudoclass :hover is only acceptable for wide use with <a> tags (links). Some browsers allow for other uses, but IE doesn't, I think.
You could do it with a mouseover.
<div onMouseover="this.bgcolor='#000000'"> (black)
Random guess, and likely won't work, but that general idea should point you in the right direction.
Hope this helps. For a more thorough answer, see what someone else suggests.

Titan85
01-18-2007, 02:19 AM
From glancing at posts as they've gone by, I believe that the pseudoclass :hover is only acceptable for wide use with <a> tags (links). Some browsers allow for other uses, but IE doesn't, I think.
You could do it with a mouseover.
<div onMouseover="this.bgcolor='#000000'"> (black)
Random guess, and likely won't work, but that general idea should point you in the right direction.
Hope this helps. For a more thorough answer, see what someone else suggests.It didn't work, which I guess you were expecting ;) . But I may have done it wrong, am i supposed to put this.bgcolor or put something in the place of "this"?

djr33
01-18-2007, 02:54 AM
"this.value" is the value of the a field in a form. Likewise, it applies to other things.
this is the shortcut command for not naming the object. Apparently, divs don't work like this (assuming there isn't something different that isn't allowing the code to work).
Additionally, onMouseover may not apply exactly that way for divs.
Really, I can't tell you exactly what to do.
I would look up onMouseover properties of a <div>, as well as a function that changes the background of a named or certain-class div.

thetestingsite
01-18-2007, 03:06 AM
I would look up onMouseover properties of a <div>, as well as a function that changes the background of a named or certain-class div.

Or you could use Javascript to change the style of the div. I had a working script that did this a while back, but lost it somehow.

Titan85
01-18-2007, 04:00 AM
I ended up using javascript, I didn't even think of it before.
<div class="button" onmouseover="this.className='buttonHover'" onmouseout="this.className='button'">works great.
I have another question that I noticed while doing this, if you look at http://echo-designes.com in IE 6, on the left, it takes the last word of "Visit Site" from above it and displays it again. If you look at the code, it is not in there at all. I set the overflow for that div to hidden and everything, but yet it still shows up. Any idea why?

djr33
01-18-2007, 06:18 AM
Ah. See? Easy. I knew it would be a simple solution... glad it works.

Sorry I couldn't be of more help.