poche 发表于 2007-4-27 10:34:27

***鼠标特效***跟着鼠标旋转的效果脚本

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
要完成此效果把如下代码加入到<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('http://code.ik8.com/html/</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+"'>http://code.ik8.com/html/+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.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.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.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.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>
      










----- - ----------------------------- ---

拥有三人行论坛管理系列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有千人在线的真实火暴效果,让您不在为论坛因没有人气而留不住会员而烦恼,使您的论坛早日成为一流 的论坛。详情请登陆网站:http://www.cnsrx.cn 三 人行论坛管理软件 ,站长 必备的专业好工具。(您使用的是免费版本, 购买收 费版本后,将不带广告 。业务 QQ:24721 64 49 852 27)
页: [1]
查看完整版本: ***鼠标特效***跟着鼠标旋转的效果脚本