码迷,mamicode.com
首页 > 编程语言 > 详细

JavaScript

时间:2018-07-05 21:21:10      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:top   BMI   ide   head   remove   fixed   div   val   NPU   

JavaScript

 

示例:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .hide {
            display:none;
        }
    </style>
</head>
<body>
    <div style="z-index: 1">
        <div id="d1", class="c1 c3", class="c2">来最后跳一支悲伤优雅的舞蹈就散场...</div>
        <div id="d2">test div</div>
        <input type="button" value="register"  onclick="register()">
    </div>

    <div class="c1 hide"; id="reg1"; style="position: fixed; height:100px; width:300px; top:50%; left: 50%;
    margin-left:-150px; margin-top:-50px; background-color: coral; z-index: 100">
        <input type="text" value="username" style="display: block;">
        <input type="password" style="display: block;">
        <input type="submit"  value="submit">
        <input type="reset">
    </div>

    <div class="c2 hide"; id=‘zzc‘; style="position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px;
    background-color: gray;opacity: 0.5; z-index: 10">

    </div>

</body>
</html>

<script>
    function test(){
        p = document.getElementById(‘d1‘)
        i = p.innerText
        j = i.charAt(0)
        k = i.substring(1, i.length)
//        alert(j,k)
        p.innerText = k + j
    }

    setInterval(‘test()‘, 500)

    function register(){
        document.getElementById(‘zzc‘).classList.remove(‘hide‘)
        document.getElementById(‘reg1‘).classList.remove(‘hide‘)
    }
</script>

 

JavaScript

标签:top   BMI   ide   head   remove   fixed   div   val   NPU   

原文地址:https://www.cnblogs.com/hinimix/p/9270062.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!