js实现一个手机端移动端答题系统效果代码

代码语言:html

所属分类:布局界面

代码描述:js实现一个手机端移动端答题系统效果代码

代码标签: 手机 移动 答题 系统 效果

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

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>选择题js特效自动下一题</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <style>
        .index {
            width: 100%;
            padding-bottom: 1.1rem;
        }

        /*topic页面*/
        .topic {
            position: relative;
            height: 100%;
            overflow-y: auto;
            width: 100%;
            background-attachment: fixed;
            box-sizing: border-box;
        }

        .topic-frameli {
            text-align: center;
            line-height: 1.5rem;
            font-size: 0.36rem;
            width: 5.65rem;
            height: 1.3rem;
            margin: 0.15rem auto 0.6rem auto;
            color: #000000;
            background-size: cover;
        }
        .topic-frameli div {
            display: inline-block;
            font-size: 0.54rem;
            color: #fbb561;
        }
        .entrance-bottom {
            width: 100%;
            position: relative;
            z-index: 10;
            height: -webkit-fill-available;
            overflow-x: hidden;
        }
        .entrance-bottom-frame {
            transition: all 0.5s;
            width: 10000%;
            margin: 0 auto;
            margin-top: 0.3rem;
        }
        .entrance-bottom-frame-beijing {
            position: absolute;
            z-index: 1;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
           
            background-size: cover;
        }
        .entrance-bottom-frame-line {
            transition: all 0.5s;
            pointer-events: none;
            cursor: default;
            width: 1%;
            float: left;
            position: relative;
            padding: 0 0.35rem;
            box-sizing: border-box;
        }
        .entrance-bottom-frame-line-id {
            font-size: 30px;
            color: white;
            text-align: center;
            line-height: 60px;
            position: absolute;
            left: 50%;
            margin-left: -30px;
            height: 60px;
            width: 60px;
        
           
            top: -30px;
        }
        .entrance-bottom-frame-line-title {
            font-size: 0.28rem;
            margin-bottom: 0.8rem;
            line-height: 0.5rem;
        }
        .entrance-bottom-frame-line-button {
            transition: margin 0.5s;
            position: relative;
            cursor: pointer;
            width: 100%;
            min-height: 0.9rem;
            margin-bottom: 0.5rem;
            float: left;
            box-sizing: border-box;
            background: #f7f7f7;
            border-radius: 0.54rem;
            padding: 0 0.5rem;
        }
        .entrance-bottom-frame-line-button-frame {
            width: 100%;
            min-height: 0.9rem;
            display: table-cell;
            vertical-align: middle;
            font-size: 0.3rem;
            padding: 0.1rem 0rem 0.1rem 0.5rem;
        }
        .entrance-bottom-frame-line-button-id {
            height: 0.9rem;
            display: table-cell;
            line-height: 0.9rem;
            font-size: 0.3rem;
        }
        .entrance-bottom-frame-line-button:hover {
            color: white;
            background: #f86d07
        }
        .entrance-bottom-frame-line.active {
            pointer-events: auto;
        }
        .entrance-bottom-frame-line.active .entrance-bottom-frame-beijing {
            display: none;
        }
        .entrance-bottom-frame-beijing.none {
            background: #000000;
            opacity: 0.2;
        }

    </style>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/flexible.js"></script>

</head>
<body>

    <div class="topic">
        <div class="entrance-bottom">
            <div class="topic-frameli"></div>
            <div class="entrance-bottom-frame clearfix">

            </div>
        </div>
    </div>

    <script type="text/javascript" charset="utf-8">
        function TiMu() {
            for (var i in data1) {
                var div = document.createElement("div");
                div.className = "entrance-bottom-frame-line";
                document.querySelector(".entrance-bottom-frame").appendChild(div);


                var div2 = document.createElement("div");
                div2.className = "entrance-bottom-frame-line-title";
                div2.innerHTML = data1[i].title;
                document.querySelectorAll(".entrance-bottom-frame-line")[i].appendChild(div2);


                var divli1 = document.createElement("div");
                divli1.innerHTML = parseInt(i) + 1;

                var timu = 1
                for (var j in data1[i].xuanxiang) {
                    var div3 = document.createElement("div");
                    div3.className = "entrance-bottom-frame-line-button";
                    var div3_id = document.createElement("div");
                    div3_id.className = "entrance-bottom-frame-line-button-id";
                    if (j == 0) {
                        div3_id.innerHTML = "A";
                    } else if (j == 1) {
                        div3_id.innerHTML = "B";
                    } else if (j == 2) {
                        div3_id.innerHTML = "C";
                    } else {
                        div3_id.innerHTML = "D";
                    }
                    var div4 = document.createElement("div");
                    div4.className = "entrance-bottom-frame-line-button-frame";
                    div4.innerHTML = data1[i].xuanxiang[j];
                    div3.appendChild(div3_id)
                    div3.appendChild(div4);
                    document.querySelectorAll(".entrance-bottom-frame-line")[i].appendChild(div3);
                    timu++
                }
            }
            mintime = 1;
            var dact = document.querySelector(".entrance-bottom-frame-line")
            var active = ".........完整代码请登录后点击上方下载按钮下载查看

网友评论0