|
打雷闪电效果 |
|
步骤一: 请将下面的原代码插入到<body>下面 ,
<STYLE>.mainbody { COLOR: #ffffff; FONT-FAMILY: Arial; FONT-SIZE: 12pt; LEFT: 260px; POSITION: absolute; TOP: 100px; WIDTH: 300px } .soundpic { LEFT: -400px; POSITION: absolute; TOP: -400px } A { COLOR: #ff0000; TEXT-DECORATION: underline overline } </STYLE> <SCRIPT language=javaScript> <!-- Beginning of JavaScript - var x,y,i var shakestrength=30 var i=shakestrength var vorzeichen=1 function showsoundpic() { if (document.all) { document.all.soundgif1.style.posTop=y-100 document.all.soundgif1.style.posLeft=x shakesound() } if (document.layers) { document.soundgif1.top=y-100 document.soundgif1.left=x shakesound() } } function shakesound() { if (document.all) { if (i > 0) { document.all.soundgif1.style.posTop+=i*vorzeichen document.all.soundgif1.style.posLeft+=i*vorzeichen vorzeichen=vorzeichen*(-1) i-- var timer=setTimeout("shakesound()",50) } else { document.all.soundgif1.style.posTop=-400 document.all.soundgif1.style.posLeft=-400 i=shakestrength clearTimeout(timer) } } if (document.layers) { if (i > 0) { document.soundgif1.top+=i*vorzeichen document.soundgif1.left+=i*vorzeichen vorzeichen=vorzeichen*(-1) i-- var timer=setTimeout("shakesound()",50) } else { document.soundgif1.top=-400 document.soundgif1.left=-400 i=shakestrength clearTimeout(timer) } } } function makesound(soundobj){ showsoundpic() var thissound= eval("document."+soundobj) thissound.play() } function handlerMM(e){ x = (document.layers) ? e.pageX : event.clientX y = (document.layers) ? e.pageY : event.clientY } if (document.layers){ document.captureEvents(Event.MOUSEMOVE); } document.onmousemove = handlerMM; // - End of JavaScript - --> </SCRIPT> <DIV class=soundpic id=soundgif1><IMG height=300 src="flash1611.gif" width=400> </DIV> <DIV class=mainbody id=mainbody><A href="http://www.1stscript.com" onmouseover="makesound('sound1')" target=_blank>感受一下雷电效果吧</A> </DIV><EMBED height=128 hidden=true name=sound1 src=thunder1611.au width=128 MASTERSOUND autostart="false"> |