凹丫丫网络社区's Archiver

Amm 发表于 2008-5-16 12:57

鼠标点亮图像

<P>&lt;style&gt;<BR>&lt;!--</P>
<P>#myimage{<BR>filter:light<BR>}</P>
<P>--&gt;<BR>&lt;/style&gt;<BR>&lt;img id="myimage" src="big/1.jpg"&gt;<BR>&lt;script language="JavaScript1.2"&gt;</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>//&nbsp;&nbsp;No need to edit below this line&nbsp;&nbsp;&nbsp;//<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&amp;&amp;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>&nbsp; if (tempX &lt; 0){tempX = 0}<BR>&nbsp; if (tempY &lt; 0){tempY = 0}<BR>&nbsp; if (t)<BR>&nbsp; {&nbsp; <BR>&nbsp;&nbsp; moveL();<BR>&nbsp; }</P>
<P>&nbsp; return true<BR>}</P>
<P>var xv = startx;<BR>var yv = starty;<BR>var t= true;<BR>if (IE&amp;&amp;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>&lt;/script&gt;</P>

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.