就是一个小方框在整个页面内乱晃内容很黄很暴力的那种
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> .one{ width:200px; height:220px; background-color:#CC3; position:absolute; top:0px; left:0px; cursor:pointer; } </style> <script> window.onload = function(){ var div1= document.getElementsByTagName("div")[0]; var sx=5,sy=5,x,y; var timer = setInterval(startMove,20); function startMove(){ if(document.documentElement.clientWidth - x < div1.offsetWidth || x<0) { sx = -sx; } if(document.documentElement.clientHeight - y < div1.offsetHeight || y<0){ sy = -sy; } x = div1.offsetLeft + sx; y = div1.offsetTop + sy; div1.style.left = x +"px"; div1.style.top = y +"px"; } div1.onmouseover=function(){ clearInterval(timer); } div1.onmouseout=function(){ timer = setInterval(startMove,20); } div1.onclick=function(){ document.body.removeChild(div1); div1=null; } } </script> </head> <body> <div class="one">专治不孕不育阳痿早泄</div> </body> </html>