PDA

View Full Version : Changing opacity levels in highlighting



32jln
01-26-2006, 08:19 PM
Forum-

How would I change the opacity level to match the "on mouseover" and "onmouseout"? Before mouseover, the image appears lightened, but once you mouseout, you can barely see the image. How do I keep it consistent?

Here are the images:
http://romneypilates.com/massage2.htm


And here is the code I used with some variation:
<----head---->
function makevisible(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 section---->
style="filter:alpha(opacity=20);-moz-opacity:0.2" onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)"



Thanks for helping! :D

jscheuer1
01-26-2006, 08:43 PM
Use:


style="filter:alpha(opacity=70);-moz-opacity:0.7"

for the images and make the line in your script like so:


strength=(which==0)? 1 : 0.7