一款JS技术实现的图片上旋转的光束效果,这个光柱以图片的中心为点转圈扫描,并且JS代码还改变了图片的色相,例如:颜色变暗、光束变亮等等,大家有没有感觉像灯塔上边的灯一样呢?转圈扫来扫去!欢迎您多多支持烈火网! 演示: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>图片扫描效果,像灯塔上的灯扫描</title> </head> <body bgcolor="#ffffff" onload=go()> <SCRIPT language=JavaScript> function LoadCookie(Key) { var CookieString = document.cookie var CookieSet = CookieString.split(';') var SetSize = CookieSet.length var CookiePieces var ReturnValue = "" var x = 0 for (x = 0; ((x < SetSize) && (ReturnValue == "")); x ++) { CookiePieces = CookieSet[x].split ('=') if (CookiePieces[0].substring (0,1) == ' ') CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length) if (CookiePieces[0] == Key) { ReturnValue = CookiePieces[1] break } } return ReturnValue } </SCRIPT> <SCRIPT> <!-- var Light_X=20 var Light_Y=20 var Light_Z=40 var xInc=10; var yInc=10; var r=125; var deg=0; var deg1; var rad; var conversion=(2*3.1415926)/360 function movefilt() { Light_X=r+r*Math.cos(deg*conversion); Light_Y=r+r*Math.sin(deg*conversion); deg+=10; if(deg==360) deg=0; Body1.filters[0].moveLight(0,Light_X,Light_Y,Light_Z,1); mytimeout=setTimeout('movefilt()',100); } function go(){ Body1.filters.light.addCone(125,125,0,Light_X,Light_Y,0,255,0,150,20); Body1.filters.light.addAmbient(0,255,0,30) var x=0; movefilt(); } </SCRIPT> <IMG height=250 id=Body1 src="/uploads/common/images/wall5.jpg" style="FILTER: light(); HEIGHT: 250px; WIDTH: 250px" width=250> </body> </html><div style="text-align:center;margin:30px 0 0 0;"><hr style="color:#999;height:1px;">如不能显示效果,请按Ctrl+F5刷新本页,更多网页代码:<a href='http://www.veryhuo.com/' target='_blank'>http://www.veryhuo.com/</a></div>提示:可修改后代码再运行! 文章导航 jQuery图片无缝滚动效果,代码简洁功能简单JavaScript实现图片上下飘动 可设置浮动速度