39,118
社区成员




<p id="l1">line 1</p>
<p hidden id="l2">line 2</p>
<p hidden id="l3">line 3</p>
<script>
var a=1
q=setInterval((function b(){try{
eval('l'+a+'.hidden=false')
a++
}catch{
clearInterval(q)
}}),1000)
</script>
<p id="l1">line 1</p>
<p hidden id="l2">line 2</p>
<p hidden id="l3">line 3</p>
<script>
var a=1
while(true){
try{
eval('l'+a+'.hidden=false')
}catch{
break
}
a++
}
</script>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
#d2 {
background-color: #ff0;
position: relative;
z-index: 99;
top: 0px;
transition: top 2s;
}
</style>
</head>
<body>
<div id="d1" style="width: 100%; height:200px;">
我是d1的内容
</div>
<div id="d2">
<img src="images/153535.jpg" width="100%" height="100%">
</div>
<script type="text/javascript">
var d1 = document.getElementById("d1");
var d2 = document.getElementById("d2");
var oh = d1.offsetHeight;
d2.style.height = oh+"px";
d2.style.marginTop = -oh+"px";
d2.style.top = oh+"px";
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
@keyframes anim{
0% {top: 0px;}
100% {top: -200px;}
}
#d2 {
background-color: #ff0;
position: relative;
z-index: 99;
animation: anim 2s forwards;
}
</style>
</head>
<body>
<div id="d1" style="width: 100%; height:200px;">
我是d1的内容
</div>
<div id="d2">
<img src="images/153535.jpg" width="100%" height="200">
</div>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<title> 页面名称 </title>
<style type="text/css">
#box {
line-height: 20px;
overflow: hidden;
height: 0;
border: 1px solid #999;
}
</style>
</head>
<body>
<div id="box">
content 1 <br>
content 2 <br>
content 3 <br>
content 4 <br>
content 5 <br>
content 6 <br>
content 7 <br>
</div>
<script type="text/javascript">
function loop() {
var box = document.getElementById("box");
var h = box.clientHeight+20;
var sh = box.scrollHeight;
box.style.height = h+"px";
if (h<sh)
setTimeout(loop, 500);
}
loop();
</script>
</body>
</html>