jquery实现摇骰子动画效果

代码语言:html

所属分类:动画

代码描述:jquery实现摇骰子动画效果

代码标签: 骰子 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">

    <style type="text/css">
        .demo {
            width: 310px;
            height: 120px;
            margin: 10px auto;
        }
        .wrap {
            width: 90px;
            height: 90px;
            margin: 120px auto 30px auto;
            position: relative
        }
        .dice {
            width: 90px;
            height: 90px;
            background: url(http://repo.bfw.wiki/bfwrepo/image/5f1108d873892.png) no-repeat;
            cursor: pointer;
        }
        .dice_1 {
            background-position: -5px -4px
        }
        .dice_2 {
            background-position: -5px -107px
        }
        .dice_3 {
            background-position: -5px -212px
        }
        .dice_4 {
            background-position: -5px -317px
        }
        .dice_5 {
            background-position: -5px -427px
        }
        .dice_6 {
            background-position: -5px -535px
        }
        .dice_t {
            background-position: -5px -651px
        }
        .dice_s {
            background-position: -5px -763px
        }
        .dice_e {
            background-position: -5px -876px
        }
        p#result {
            text-align: center;
            font-size: 16px
        }
        p#result span {
            font-weight: bold;
            color: #f30;
            margin: 6px
        }
        #dice_mask {
            width: 90px;
            height: 90px;
            background: #fff;
            opacity: 0;
            position: absolute;
            top: 0;
            left: 0;
            z-index: 999
        }

    </style>
    <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>
    <script type="text/javascript">
        $(function() {
            var dice = $("#dice");
            dice.........完整代码请登录后点击上方下载按钮下载查看

网友评论0