jquery实现一个手机端移动端抓娃娃娃娃机游戏效果代码

代码语言:html

所属分类:游戏

代码描述:jquery实现一个手机端移动端抓娃娃娃娃机游戏效果代码

代码标签: 手机 移动 端抓 娃娃 娃娃机 游戏 效果

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

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

    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/jquery-3.2.1.min.js"></script>

    <style>
        * {
            margin: 0;
            padding: 0;
            list-style: none;
            text-decoration: none;
        }
        html,body {
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
        .box {
            width: 100%;
            height: 100%;
            background: url(//repo.bfw.wiki/bfwrepo/image/60cc874abd4db.png) no-repeat center;
            background-size: cover;
        }
        .paw {
            width: 100%;
            height: 20px;
            background: #8d3835;
            position: relative;
            box-shadow: 2px 2px 5px rgba(0,0,0,0.3)
        }
        .pawer {
            width: 10px;
            background: #565656;
            height: 20px;
            position: absolute;
            top: 20px;
            left: 50%;
            margin-left: -5px;
            box-shadow: 2px 2px 5px rgba(0,0,0,0.3)
        }
        .pawerPic {
            width: 110px;
            height: 85px;
            position: absolute;
            top: 40px;
            left: 50%;
            margin-left: -55px;
        }
        .lose {
            width: 100px;
            height: 85px;
            display: block;
            margin: 0 auto;
        }
        .pawerPic.on .lose {
            display: none;
        }
        .pawerPic.on .win {
            display: block;
        }
        .win {
            width: 110px;
            height: 105px;
            display: none;
            margin: 0 auto;
            background: url(images/jiazi2.png);
            background-size: cover;
            overflow: hidden;
        }
        .win img {
            display: block;
            margin: 0 auto;
            margin-top: 12px;
        }
        .btn {
            width: 120px;
            height: 120px;
            position: absolute;
            bottom: 0;
            left: 50%;
            margin-left: -60px;
        }
        .btn2 {
            width: 120px;
            height: 120px;
            position: absolute;
            bottom: 0;
            left: 50%;
            margin-left: -60px;
            background: url(images/kaishi2.png) no-repeat center;
            background-size: contain;
            display: none;
        }
        .btn.on .btn_star {
            display: none;
        }
        .btn_star {
            background: url(//repo.bfw.wiki/bfwrepo/image/60cc8723205a0.png) no-repeat center;
            background-size: contain;
            width: 120px;
            height: 120px;
        }
        .btn_end {
            background: url(//repo.bfw.wiki/bfwrepo/image/60cc87351190c.png) no-repeat center;
            background-size: contain;
            width: 120px;
            height: 120px;
        }
        .area {
            width: 100%;
            height: auto;
            overflow: hidden;
            position: absolute;
            top: 40px;
            left: 0;
        }
        /*娃娃滚动*/
        #pack {
            width: 100%;
            height: 90px;
            white-space: nowrap;
            overflow: hidden;
            position: absolute;
            bottom: 0;
            left: 0;
        }
        #sel1,#sel2 {
            display: inline;
        }
        #pack img {
            display: inline-block;
            height: 90px;
        }
    </style>

</head>
<body>
    <!--盒子-->
    <div class="box">
        <!--爪子-->
        <div class="paw">
            <div class="pawer"></div>
            <div class="pawerPic">
                <img src="//repo.bfw.wiki/bfwrepo/image/60cc87634d385.png" class="lose">
                <div class="win">
                    <img src="//repo.bfw.wiki/bfwrepo/image/60cc8773710d0.png">
                </div>
            </div>
        </div>
        <!--区域-->
        <div class="area">
            <!--娃娃滚动-->
            <div id="pack">
                <div id="sel1">
                    <img src="//repo.bfw.wiki/bfwrepo/image/60cc8773710d0.png" tr="1">
                    <img src="//repo.bfw.wiki/bfwrepo/image/60cc8773710d0.png" tr="2">
                    <img src="//repo.bfw.wiki/bfwrepo/image/60cc8773710d0.png" tr="3">
                    <img src="//repo.bfw.wiki/bfwrepo/image/60cc8773710d0.png" tr="4">
                    <img src="//repo.bfw.wiki/bfwrepo/image/60cc8773710d.........完整代码请登录后点击上方下载按钮下载查看

网友评论0