caipiao
随机抽选
caipiao * { margin:0; padding: 0; } #wrap { width:621px; margin:0 auto; padding:50px 0; background-color:rgb(255, 242, 242); } #inner { width:490px; margin:0 auto; overflow: hidden; } #inner span { float: left; width:30px; height: 30px; border-radius: 15px; border:1px solid #d9d9d9; line-height: 30px; text-align: center; color:#333; background-color: #f8f8f8; margin:18px 6px; } #inner span.active { background-color: red; color:#fff; } #wrap p { text-align: center; } button { border:none; outline: none; width:120px; height: 40px; line-height: 40px; font-size: 20px; border-radius: 4px; } #selectBtn { background-color: red; color:#fff; } 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
要实现点击得到自动随机数还得在clearBtn.onclick前面添加个定时器
var timer = 0;
selectBtn.onclick = function() {
clearTimeout(timer);
timer = setInterval(selectBall,100);
setTimeout(function() {
clearTimeout(timer);
},3000)
// clearTimeout(timer);
}
这样就实现了动态图的功能了(*^__^*) 嘻嘻!
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持考高分网!



