Highlighting Image on Mouseover using Java script
We can highlight our images in web site by using the following JavaScript code between HEAD tags:
<SCRIPT language=”JavaScript”>
function makevisible_fn(cur,which){
strength=(which==0)? 1 : 0.2
if (cur.style.MozOpacity)
cur.style.MozOpacity=strength
else if (cur.filters)
cur.filters.alpha.opacity=strength*100
}
</SCRIPT>
<img src=”imagename.jpg” mce_src=”imagename.jpg” style=”filter:alpha(opacity=20);-moz-opacity:0.2″ onMouseover=”makevisible_fn(this,0)” onMouseout=”makevisible_fn(this,1)”>
In above code,
style=”filter:alpha(opacity=20);-moz-opacity:0.2″ onMouseover=”makevisible_fn(this,0)” onMouseout=”makevisible_fn(this,1)”
will give the fade effect for the image. we can use the above code in all the images, that will give fade effect.
