鼠标点亮图像
<P><style><BR><!--</P><P>#myimage{<BR>filter:light<BR>}</P>
<P>--><BR></style><BR><img id="myimage" src="big/1.jpg"><BR><script language="JavaScript1.2"></P>
<P>s = 50; // the size of the spotlight<BR>vp = 10; // the visibility percent of the picture<BR>startx = 0; // the top position of your sportlight into the image (on start)<BR>starty = 0; // the left position of your spotlight into the image (on start)</P>
<P><BR>//////////////////////////////////////////////////////////////////<BR>// No need to edit below this line //<BR>//////////////////////////////////////////////////////////////////</P>
<P>var IE = document.all?true:false</P>
<P>function moveL()<BR>{<BR>xv = tempX;<BR>yv = tempY;<BR>myimage.filters.light.MoveLight(1,xv,yv,s,true);<BR>}</P>
<P>if (IE&&myimage.filters)<BR>document.all.myimage.onmousemove = getMouseXY;<BR>var tempX = 0<BR>var tempY = 0</P>
<P><BR>function getMouseXY(e) {<BR>tempX = event.offsetX<BR>tempY = event.offsetY</P>
<P> if (tempX < 0){tempX = 0}<BR> if (tempY < 0){tempY = 0}<BR> if (t)<BR> { <BR> moveL();<BR> }</P>
<P> return true<BR>}</P>
<P>var xv = startx;<BR>var yv = starty;<BR>var t= true;<BR>if (IE&&myimage.filters){<BR>myimage.style.cursor="hand";<BR>myimage.filters.light.addAmbient(255,255,255,vp)<BR>myimage.filters.light.addPoint(startx,starty,s,255,255,255,255)<BR>}</P>
<P></script></P>
页:
[1]