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>
原文:https://www.cnblogs.com/hinimix/p/9270062.html