JoeAtRevolutionUnltd
Programmer
I have a menu made from a UL with my own list image. Would it be possible to have the list image change when you hover over a menu item?
Thanks
Thanks
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<style type="text/css">
li {
list-style-image: url(normal.png);
}
li:hover {
list-style-image: url(rollover.png);
}
</style>
<html>
<head>
<style type="text/css">
ul.rollover li {
list-style-image: url(red.png);
}
ul.rollover li:hover,ul.rollover li.rohover {
list-style-image: url(green.png);
}
</style>
<script type="text/javascript">
function rolloverize()
{
if (navigator.userAgent.indexOf('MSIE')==-1) return;
ul=document.getElementsByTagName('ul');
for (i=0;i<ul.length;i++) if (ul[i].className=='rollover') {
li=ul[i].getElementsByTagName('li');
for (j=0;j<li.length;j++) {
li[j].onmouseover=function() { this.className='rohover' }
li[j].onmouseout=function() { this.className='' }
}
}
}
</script>
</head>
<body onload="rolloverize()">
<ul class="rollover">
<li>one</li>
<li>two</li>
<li>three</li>
</ul>
</body>
</html>