中国网站美工网!网页设计者的天堂!
本站特色:HTML网页模版下载    
  您的位置:

首页 >> 网页特效 >> 鼠标特效 >> 正文

相关信息

鼠标旁边总是跟着图片,放上问候
禁止鼠标左键。
鼠标控制窗口开关
禁用右键并自动导航
鼠标激活警告框
跟随鼠标的字符
在鼠标后面跟着一串飘动的字符
字符围绕鼠标
鼠标放到链接上就会出现一个说明
非图片鼠标跟踪器
鼠标放上去打开新页面 (慎用..)
禁用鼠标左右键 --用处大大的有吆
鼠标控制窗口开关
禁用右键并自动导航
右键自动链接页面
图片跟随鼠标
跟随鼠标星星第二部份
跟随鼠标旋转的七彩环背景用黑色
任意用鼠标拖动图片。
跟随鼠标的萤火虫[无须修改][]共

跟着鼠标旋转的效果脚本

跟着鼠标旋转的效果脚本


来源: 本站原创 | 时间: 2007-1-7 19:29:08 | 人气:

 

跟着鼠标旋转的效果脚本

要完成此效果把如下代码加入到<body>区域中

<script language="JavaScript">
<!-- 
var images='http://www.jsshow.com/img/23.gif';//Put your image name here!!
var amount=8;       //Number of images here!!
var yBase = 150;
var xBase = 200;
var step = 0.2;
var currStep = 0;
var Xpos = 5;
var Ypos = 5;
var i = 0;
var j = 0;
if (document.all)
{
document.write('<div id="ieDiv" style="position:absolute;top:0px;left:0px">')
document.write('<div id="c" style="position:relative">');
for (n=0; n < amount; n++)
document.write('<img src=" '+images+'" style="position:absolute;top:0px;left:0px">')
document.write('</div>')
document.write('</div>')

function MsieMouseFollow(){
 Xpos = document.body.scrollLeft+event.x-5;
 Ypos = document.body.scrollTop+event.y-5;
 }
 document.onmousemove = MsieMouseFollow;
}
else if (document.layers)
{
window.captureEvents(Event.MOUSEMOVE);
for (ns=0; ns < amount; ns++)
document.write("<LAYER NAME='n"+ns+"' LEFT=0 TOP=0><IMG SRC='"+images+"'></LAYER>");
function NsMouseFollow(evnt){
 Xpos = evnt.pageX-5;
 Ypos = evnt.pageY-5;
 }
 window.onMouseMove = NsMouseFollow;
}
function Swirl(){
if (document.all)
{
 yBase = window.document.body.offsetHeight/4;
 xBase = window.document.body.offsetWidth/4;
}
else if (document.layers)
{
 yBase = window.innerHeight/4;
 xBase = window.innerWidth/4;
}

if (document.all)
{
 for (i=0;i<ieDiv.all.c.all.length;i++)
 {
  ieDiv.all.c.all[i].style.top = Ypos +

Math.cos((20*Math.sin(currStep/20))+i*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep

+ i*25)/10);
  ieDiv.all.c.all[i].style.left = Xpos +

Math.sin((20*Math.sin(currStep/20))+i*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep

+ i*25)/10);
 }
}
else if (document.layers)
{
 for ( j = 0 ; j < ns ; j++ ) //7 is number of NS layers!
 {
  var temp="n"+j
  document.layers[temp].top = Ypos +

Math.cos((20*Math.sin(currStep/20))+j*70)*yBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep

+ j*25)/10);
  document.layers[temp].left =Xpos +

Math.sin((20*Math.sin(currStep/20))+j*70)*xBase*(Math.sin(10+currStep/10)+0.2)*Math.cos((currStep

+ j*25)/10);
 }
}
currStep += step;
setTimeout("Swirl()", 10);
}
Swirl();
// -->
</script>

 
  上一篇:鼠标旁边总是跟着图片,放上问候语蛮合适的  下一篇:没有了
Copyright © 2005 - 2006 WEB600.Net,All Rights Reserved
业务联系 QQ 站长:106324307 美工:270348300 程序:63888546
E-mail: 3235183@163.com MSN: fuqiyangru@hotmail.com
中国网站美工网--网页设计者的天堂! 陕ICP备06005517号
本站资源来自互联网 如果侵犯您的权利 请通知我们 我们会尽快删除