87,994
社区成员
发帖
与我相关
我的任务
分享
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<meta content="yes" name="apple-mobile-web-app-capable">
</head>
<style type="text/css">
*{padding:0;margin:0;}
#cc{
background:#ccc;
width:200px;
height:200px;
position:absolute;
bottom:0;
right:0;
white-space:nowrap;
overflow:hidden;
display:none;
}
</style>
<body style="height:2000px;">
<div id="cc">111</div>
<script type="text/javascript">
var cc = document.getElementById("cc");
var ys = window.getComputedStyle?window.getComputedStyle(cc,""):cc.currentStyle;
var hqc = parseInt(ys.width);
var hqg = parseInt(ys.height);
var sc = document.documentElement.clientWidth;
var sg = document.documentElement.clientHeight;
var jsr = Math.ceil((sc - hqc)/2);
var jsx = Math.ceil((sg - hqg)/2);
var ys = 5;
var yd = ys * jsx / jsr ;
var time = null;
var bottom = 0;
var right = 0;
setTimeout(function aaa(){
cc.style.display = "block";
time = setInterval(function zzz(){
right += ys;
bottom += yd;
cc.style.right = right + "px";
cc.style.bottom = bottom + "px";
if(right>=jsr){
clearInterval(time);
setTimeout(function(){
ys = -ys;
yd = -yd;
time = setInterval(zzz,10);
},2000)
}
if(right == 0 || bottom == 0){
clearInterval(time);
cc.style.right = 0;
cc.style.bottom = 0;
cc.style.display = "none";
ys = -ys;
yd = -yd;
setTimeout(aaa, 6000);
}
},10);
},3000);
</script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<meta content="yes" name="apple-mobile-web-app-capable">
</head>
<style type="text/css">
*{padding:0;margin:0;}
#cc{
background:#ccc;
width:200px;
height:200px;
position:absolute;
bottom:0;
right:0;
white-space:nowrap;
overflow:hidden;
display:none;
}
</style>
<body style="height:2000px;">
<div id="cc">111</div>
<script type="text/javascript">
var cc = document.getElementById("cc");
var ys = window.getComputedStyle?window.getComputedStyle(cc,""):cc.currentStyle;
var hqc = parseInt(ys.width);
var hqg = parseInt(ys.height);
var sc = document.documentElement.clientWidth;
var sg = document.documentElement.clientHeight;
var jsr = Math.ceil((sc - hqc)/2);
var jsx = Math.ceil((sg - hqg)/2);
var ys = 5;
var yd = ys * jsx / jsr ;
var time = null;
var bottom = 0;
var right = 0;
setTimeout(function aaa(){
cc.style.display = "block";
time = setInterval(function zzz(){
right += ys;
bottom += yd;
cc.style.right = right + "px";
cc.style.bottom = bottom + "px";
if(right>=jsr){
clearInterval(time);
cc.onclick=function(){
ys = -ys;
yd = -yd;
setTimeout(function(){
time = setInterval(zzz,10);
},0)
}
}
if(right == 0 || bottom == 0){
clearInterval(time);
cc.style.right = 0;
cc.style.bottom = 0;
cc.style.display = "none";
ys = -ys;
yd = -yd;
setTimeout(aaa, 6000);
}
},10);
},3000);
</script>
</body>
</html>