有趣的JavaScript脚本:让图片飞起来 图章 图章

JavaScript
技之树 2021-9-11

3801 2

代码

R = 0;
x1 = .1;
y1 = .05;
x2 = .25;
y2 = .24;
x3 = 1.6;
y3 = .24;
x4 = 300;
y4 = 200;
x5 = 300;
y5 = 200;
var DI = document.getElementsByTagName("img");
DIL = DI.length;

function A() {
    for (i = 0; i < DIL; i++) {
        DIS = DI[i].style;
        DIS.position = 'absolute';
        DIS.left = Math.sin(R * x1 + i * x2 + x3) * x4 + x5 + "px";
        DIS.top = Math.cos(R * y1 + i * y2 + y3) * y4 + y5 + "px"
    }
    R++
}
tag = setInterval('A()', 5);
document.onmousedown = function () {
    clearInterval(tag);
    for (i = 0; i < DIL; i++) {
        DI[i].style.position = "static";
    }
};
void(0)
这家伙太懒了,什么也没留下。
最新回复 (2)
  • 飞升成仙 lcvy
    0 3
    emmm,建议上个效果图~
    这家伙太懒了,什么也没留下。
    2021-9-12 回复
  • 筑基入门 tenyet
    0 2
    可以😌
    这家伙太懒了,什么也没留下。
    2021-9-11 回复
    • YiOVE论坛
      4
         
返回