js实现向左轮换答题效果代码

代码语言:html

所属分类:其他

代码描述:js实现向左轮换答题效果代码

代码标签: 轮换 答题 效果

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

<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>

        .entrance-bottom {
            width: 100%;
            margin-top: 40px;
            overflow: hidden;
            margin-bottom: 50px;
            position: relative;
            height: 700px;
        }
        .entrance-bottom-frame {
            transition: all 0.8s;
            width: 10000%;
            margin: 0 auto;
            height: 630px;
            margin-top: 40px;
            position: absolute;
            left: 50%;
            margin-left: -550px;
        }
        .entrance-bottom-frame-beijing {
            position: absolute;
            z-index: 1;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            background: url(//repo.bfw.wiki/bfwrepo/image/60fe3c9d05beb.png);
            background-size: cover;
        }
        .entrance-bottom-frame-line {
            -webkit-filter: grayscale(100%);
            /* CSS3 filter方式,webkit内核方式,firefox外的绝大部分的现代浏览器*/
            -moz-filter: grayscale(100%);
            /* 目前没有实现 */
            -ms-filter: grayscale(100%);
            -o-filter: grayscale(100%);
            filter: grayscale(100%);
            /* CSS3 filter方式,标准写法*/
            filter: gray;
            /* IE 6-9 */
            transition: all 0.8s;
            pointer-events: none;
            cursor: default;
            margin-top: 35px;
            box-shadow: 0 0 15px #c5e2ff;
            width: 1000px;
            height: 570px;
            float: left;
            margin-left: 50px;
            position: relative;
        }
        .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;
            background: url(//repo.bfw.wiki/bfwrepo/image/60fe3c66e9401.png);
            background-size: cover;
            top: -30px;
        }
        .entrance-bottom-frame-line-title {
            font-size: 14px;
            width: 900px;
            margin: 70px auto 20px auto;
        }
        .entrance-bottom-frame-line-button {
            transition: margin 0.8s;
            position: relative;
            cursor: pointer;
            width: 420px;
            height: 70px;
            margin: 10px 20px 0px 45px;
            float: left;
            box-sizing: border-box;
            background: #f2f2f2;
            border-radius: 36px;
            padding: 0 35px;
        }
        .entrance-bottom-frame-line-button-id {
            width: 30px;
            line-height: 70px;
            display: table-cell;
            font-size: 24px;
        }
        .entrance-bottom-frame-line-button-frame {
            line-height: 20px;
            width: 335px;
            height: 70px;
            display: table-cell;
            vertical-align: middle;
        }
        .entrance-bottom-frame-line-button:hover {
            color: white;
            background: -webkit-linear-gradient(left,#ff916a, #ff6a6b);
            /* Safari 5.1 - 6.0 */
            background: -o-linear-gradient(right,#ff916a, #ff6a6b);
            /* Opera 11.1 - 12.0 */
            background: -moz-linear-gradient(right,#ff916a, #ff6a6b);
            /* Firefox 3.6 - 15 */
            background: linear-gradient(toright,#ff916a, #ff6a6b);
            /* 标准的语法 */
        }
        .entrance-bottom-frame-line.active {
            pointer-events: auto;
            height: 630px;
            margin-top: 0;
            -webkit-filter: grayscale(0%);
            /* CSS3 filter方式,webkit内核方式,firefox外的绝大部分的现代浏览器*/
            -moz-filter: grayscale(0%);
            /* 目前没有实现 */
            -ms-filter: grayscale(0%);
            -o-filter: grayscale(0%);
            filter: grayscale(0%);
            /* CSS3 filter方式,标准写法*/
            filter: none;
        }
        .entrance-bottom-frame-line.active .entrance-bottom-frame-line-button {
            margin-top: 30px;
        }
        .entrance-bottom-frame-line.active .entrance-bottom-frame-beijing {
            display: none;
        }
        .entrance-bottom-frame-beijing.none {
            background: #000000;
            opacity: 0.2;
        }
        .pre_message {
            width: 900px;
            height: 280px;
            overflow-y: auto;
            overflow-x: hidden;
            padding: 35px 90px;

            box-sizing: border-box;
            outline: none;
            border: 0;
            white-space: pre-wrap;
            word-break: normal;
            background: url(//repo.bfw.wiki/bfwrepo/image/60fe3c8448b3f.png);
            margin: 0 auto;
            font-size: 14px;
        }
        .pre_message::-webkit-scrollbar {
            display: none;
        }

    </style>
</head>
<body>
    <div class="index">
        <div class="entrance-bottom">
            <div class="entrance-bottom-frame clearfix">

            </div>
        </div>
    </div>
</body>
<script type="text/javascript">
    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 beijing = document.createElement("div");
            beijing.className = "entrance-bottom-frame-beijing";
            document.querySelectorAll(".entrance-bottom-frame-line")[i].appendChild(beijing);

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

            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 code = document.createElement("code");
            var pre = document.createElement("pre");
            code.innerHTML = data1[i].code;
            pre.appendChild(code);
            pre.className = "pre_message"
            document.querySelectorAll(".entrance-bottom-frame-line")[i].appendChild(pre);

            for (var j in data1[i].xu.........完整代码请登录后点击上方下载按钮下载查看

网友评论0