...

View Full Version : make mouseover unobtrusive



buildrebuild
06-05-2007, 03:05 PM
Hi,
I have this code but want to put the event handlers in a javascript file unobtrusively. Can this be done.

I will be attaching the mousovers to many divs.

Thanks,
C

<div onMouseOver="onmouseoverHover(this)"
onmouseout="onmouseoutHover(this)">
<a href="movies/aptana_colorization/colorization.html" target="_blank">
<img alt="" src="thumb_overlay.png" class="overlay"/>
<img src="screenshot_colorization_thumb.png" alt="View Video" class="thumbnail"/>

</a>
</div>

glenngv
06-05-2007, 04:30 PM
var div = document.getElementById("linkDiv");
div.onmouseover = function(){
onmouseoverHover(this);
}
div.onmouseout = function(){
onmouseoutHover(this);
}

<div id="linkDiv">
<a href="movies/aptana_colorization/colorization.html" target="_blank">
<img alt="" src="thumb_overlay.png" class="overlay"/>
<img src="screenshot_colorization_thumb.png" alt="View Video" class="thumbnail"/></a>
</div>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum