js实现了用鼠标闪烁来旋转色块的方法。

js实现了用鼠标闪烁来旋转色块的方法。
本文阐述了js实现一个带有鼠标闪烁的色块的方法,供大家参考,具体实现方法如下:

复制代码代码如下所示:
js的闪烁颜色块与鼠标

<!——

如果(文件all){

颜色=新的数组('ff0000 ','00ff00 ','3366ff ','ff00ff ','ffa500 ',' ffffff ','fff000)

金额= colours.length;

ygetdelay = 0,XgetDelay 0,Ydelay 0,Xdelay 0,步= 0.2,currstep = 0,我= 0,MX = 0;

document.write('');

对于(i = 0;i <量;i +)

document.write(' ');

document.write('');

ini = 1;

gstep = 1;

功能iMouse(){

=事件;

}

移动鼠标= iMouse文件。

函数模糊(){

ini = gstep;

DT = setTimeout('dim()',10);

如果(INI < 2){

ClearTimeout(DT);

辉光();

}

}

函数辉光(){

ini = gstep;

GT = setTimeout('glow()',10);

如果(ini > 14){

ClearTimeout(GT);

(暗淡);

}

}

函数星(){

ie.style顶= document.body.scrolltop;

对于(i = 0;i <量;i +)

{

VAR层= iestars {我}。风格;

层。过滤= 'glow(颜色= +颜色+ {我},强度= + INI + ')';

层。最高ydelay + 100 * Math.sin(((5 * Math.sin(((currstep-15.99) / 10))+我×70)×Math.sin((currstep) / 10)* Math.cos(currstep +我* 25)/ 10);

层。左= xdelay + 180 * Math.cos(((5 * Math.sin((currstep-15.99) / 10))+我×70)×Math.sin((currstep) / 10)* Math.cos((currstep +我* 25)/ 10);

}

currstep + =步;

}

函数延迟(){

ydelay = ygetdelay + =(YgetDelay)* 1 / 20;

xdelay = xgetdelay + =(MX XgetDelay)* 1 / 20;

Stars();

('delay setTimeout()',10);

}

Delay();

辉光();

}

希望本文能对大家的javascript程序设计有所帮助。

tag:方法闪烁实现了用鼠标电脑软件

相关内容