笔记本作为背景的老虎机抽奖

来源:https://www.sucaihuo.com/js/586.html 2015-12-07 03:40浏览(1787) 收藏

分享一个老虎机抽奖演示效果,是数字上下滚动的效果,点击上面的数字,可以控制转动速度。
笔记本作为背景的老虎机抽奖
分类:抽奖 > 老虎机 难易:
查看演示 下载资源 下载积分: 20 积分
关注公众号,免费赠送安装视频教程、环境和学习视频,后面会不断更新。

抽奖奖品角度设置

function letGo() {

    TextNum1 = parseInt(Math.random() * 4)//随机数
    TextNum2 = parseInt(Math.random() * 7)
    TextNum3 = parseInt(Math.random() * 7)

    var num1 = [-549, -668, -786, -904][TextNum1];//在这里随机
    var num2 = [-1377, -1495, -1614, -430, -549, -668, -786, -904][TextNum2];
    var num3 = [-1377, -1495, -1614, -430, -549, -668, -786, -904][TextNum3];
    $(".num-con1").animate({"top": -1140}, 1000, "linear", function() {
        $(this).css("top", 0).animate({"top": num1}, 1000, "linear");
    });
    $(".num-con2").animate({"top": -1140}, 1000, "linear", function() {
        $(this).css("top", 0).animate({"top": num2}, 1800, "linear");
    });
    $(".num-con3").animate({"top": -1140}, 1000, "linear", function() {
        $(this).css("top", 0).animate({"top": num3}, 1300, "linear");
    });

}

重写来一次

function reset() {
    $(".num-con1,.num-con2,.num-con3").css({"top": -430});
}
标签: 抽奖老虎机
评论0
头像

系统已开启自动识别垃圾评论机制,识别到的自动封号,下载出错或者资源有问题请联系全栈客服QQ 1915635791

1 2