Javascript

by Anne Newnham <anne(at)ak.planet.gen.nz>

 Date:  Fri, 11 Aug 2000 11:42:58 +1200
 To:  hwg-basics(at)hwg.org
  todo: View Thread, Original
Hi listees,
I have been using a script for a sort of rollover effect (I got
it from dynamicdrive). It varies the opacity of an image so it appears
brighter when the mouse is on it. I really like it because you only need
one image and the script is very concise. But it only works in IE.
Does anyone know if it could be altered to work in Netscape as well?

This is the script:

This goes in the <head>
<script language="JavaScript1.2">

function makevisible(cur,which){
if (which==0)
cur.filters.alpha.opacity=100
else
cur.filters.alpha.opacity=40
}
</script>

This goes in the <body> after the image src
<style="filter:alpha(opacity=40)"
onMouseover="makevisible(this,0)" onMouseout="makevisible(this,1)">


Anne Newnham
anne(at)pl.net
Auckland, New Zealand

Anne Newnham
anne(at)pl.net
Auckland, New Zealand

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA