Forum Moderators: open

Message Too Old, No Replies

resizing scroll bars on mouseoverover

         

cuce

11:05 pm on May 31, 2006 (gmt 0)

10+ Year Member



I want to make it so these li's add 20 px to their width on mouseover. I'm not sure why this does not work. Any help?
Thanks!

heres my js

function funkay()
{
var suckaz = document.getElementsByTagName("li");
suckaz.onmouseover = function() {this.style.width = 320 + "px";};
}

window.onload = funkay;

heres my html
<ul>
<li style="width:300px"><a href="#">link</a></li>
<li style="width:300px"><a href="#">link</a></li>
</ul>

birdbrain

3:42 am on Jun 1, 2006 (gmt 0)



Hi there cuce,

try it like this...


<script type="text/javascript">
<!--
function funkay() {
var suckaz=document.getElementsByTagName('li');
for(c=0;c<suckaz.length;c++) {
suckaz[c].onmouseover=function() {
this.style.width=320+'px';
}
}
}
window.onload=funkay;
//-->
</script>

birdbrain