CSS Rollovers Using JScript in IE 6.0 Problem
I have a site that uses CSS rollovers, and requires a .htc document to make them work in IE. But unfortunately, this document is slowing down the page's load time substantially. To test this, I removed the link to the .htc doc from the CSS stylesheet, and it loaded pretty well in IE 6.0. But if the reference is there, it takes forever to load. If anyone can view the code below (JScript) and let me know where I'm going wrong, it would be greatly appreciated. Thanks.
.htc doc in JScript:
<PUBLIC:ATTACH EVENT="onmouseover" ONEVENT="DoHover()" />
<PUBLIC:ATTACH EVENT="onmouseout" ONEVENT="RestoreHover()" />
<PUBLIC:ATTACH EVENT="onmousedown" ONEVENT="DoActive()" />
<PUBLIC:ATTACH EVENT="onmouseup" ONEVENT="RestoreActive()" />
<script language="JScript">
function DoHover()
{ element.className += ' hover';
}
function DoActive()
{ element.className += ' active';
}
function RestoreHover()
{ element.className = element.className.replace(/\bhover\b/,'');
}
function RestoreActive()
{ element.className = element.className.replace(/\bactive\b/,'');
}
</script>
KWilliams
|