/ Published in: JavaScript
This is the javascript code that enables you to create hover effects also in IE6. It's clean, it's light, it's super! :)
Apply that code to your document (eg. in ) and in css add like this:
ul li:hover, ul li.shover { your css styles }
Explain: IE6 will on mouse over element add .shover to that element.
Expand |
Embed | Plain Text
<!--[if lte IE 6]> <script type="text/javascript"> sfHover = function() { var sfEls = document.getElementById("mainNav").getElementsByTagName("LI"); for (var i=0; i<sfEls.length; i++) { sfEls[i].onmouseover=function() { this.className+=" sfhover"; } sfEls[i].onmouseout=function() { this.className=this.className.replace(new RegExp(" sfhover\\b"), ""); } } } if (window.attachEvent) window.attachEvent("onload", sfHover); </script> <![endif]-->
Comments
Subscribe to comments
You need to login to post a comment.

oh, I forgot!!! ... change the "mainNav" to your ID! :) that's ID of your UL element.
Please, forgive me... another bug in my submission... Apply that code to your document (eg. in ) and in css add like this -> ul li:hover, ul li.sfhover { your css styles }
like this?
css: .flameone:hover, .flameone.shover { background:url(img/act_h.png) no-repeat -5px 0; }
html
or something wrong?? ps i have gradient background for a:hover it doesn't work..((
Likee this?
css:
.flameone:hover, .flameone.shover { background:url(img/act_h.png) no-repeat -5px 0; }
html
Likee this?
css:
.flameone:hover, .flameone.shover { background:url(img/act_h.png) no-repeat -5px 0; }
html
head> 1
Likee this?
css:
.flameone:hover, .flameone.shover { background:url(img/act_h.png) no-repeat -5px 0; }
html
[URL=http://www.radikal.ru][IMG]http://s11.radikal.ru/i183/1001/42/583df936f42e.jpg[/IMG][/URL]
or something wrong?? ps i have gradient background for a:hover it doesn't work..((
Likee this?
css:
.flameone:hover, .flameone.shover { background:url(img/act.png) no-repeat -5px 0; }
html
http://s11.radikal.ru/i183/1001/42/583df936f42e.jpg
or something wrong?? ps i have gradient background for a:hover it doesn't work..((
in this case... you should have: ** .flameone:hover, .flameone.sfhover**
that's "sfhover" and NOT shover