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; } }

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

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据