qq_37219114 2017-01-05 15:18 采纳率: 33.3%
浏览 2479

怎么设置老虎机的跑动效果

就是我已经设置好了一个按钮 控制开和关;我想弄成按一下按钮后就自动滚动起来的效果。像老虎机一样。几秒钟后自己慢慢的停下来。求大神帮帮忙。急急急

  • 写回答

2条回答 默认 最新

  • qq_37219114 2017-01-05 15:16
    关注
    div{position:absolute;border:1px solid red;height:50;width:50;text-align:center;top:100;background-color:rgb(2,255,255);background-size:100%;color:yellow;} div:nth-child(n+8):nth-child(-n+15){right:800;} div:nth-child(n+16):nth-child(-n+23){top:450;} div:nth-child(n+23):nth-child(-n+28){right:450} span{margin:20px;} #w1{right:450;} #w2{right:500;} #w3{right:550;} #w4{right:600;} #w5{right:650;} #w6{right:700;} #w7{right:750;} #w8{right:800;} #w9{top:150} #w10{top:200;} #w11{top:250;} #w12{top:300;} #w13{top:350;} #w14{top:400;} #w15{top:450;} #w16{right:750} #w17{right:700} #w18{right:650;} #w19{right:600;} #w20{right:550;} #w21{right:500;} #w22{right:450;} #w23{top:400} #w24{top:350} #w25{top:300} #w26{top:250} #w27{top:200} #w28{top:150} #n{position:absolute;right:600;top:250;height:100;width:100;border-radius:90% 60% 90% 60%;background:url(0.jpg);background-size:100%}
    王贵纳
    王灿
    张利江
    钟备
    贺飞
    李小龙
    陈文峰
    王枭
    赵书巍
    陈诚
    付羽杰
    雷飞
    王伟
    尹帅
    谢铭明
    李道鹏
    李俊
    恭函
    杨鑫鑫
    康平
    汪科玉
    周庆
    罗老师
    罗老师
    罗老师
    罗老师
    罗老师
    罗老师

    开始

    var c=0; function aa(){ var a=document.getElementsByTagName('div'); for(var i=0;i<=a.length-1;i++){ a[i].style.background="rgb(2,255,255)" a[c].style.background="rgb(255,0,0)" } c++; if(c>27){ c=0; } console.log(a) } var r=true; //设置开始或者结束的标记 function xx(){ var begin=document.getElementById("n"); if(r==true){ setId=setInterval("aa()",50); begin.innerHTML="结束"; r=false; }else{ clearInterval(setId); begin.innerHTML="开始"; r=true; } }

    这 是已经写好的代码。。供参考。。

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?