屏幕进行抖动(类似于qq抖动)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
#myBody{
position: absolute;
}
</style>
</head>
<body id="myBody">
屏幕抖动效果
<script>
var body=document.body;
var num=0;
setInterval(function(){
num=num+1;
if(num%4==1){
body.style.left="3px";
body.style.top="3px";
}
if(num%4==2){
body.style.left="-3px";
body.style.top="-3px";
}
if(num%4==3){
body.style.left="3px";
body.style.top="-3px";
}
if(num%4==0){
body.style.left="-3px";
body.style.top="-3px";
}
},30);
</script>
</body>
</html>