<span style="white-space:pre"> </span>var i=0;//记录次数 var timer;//定时器id //设置弹出广告 onload=function(){ //间隔四秒展示一次广告 timer = setInterval(showAd,4000); } //展示2秒以后隐藏广告的方法 function showAd(){ i++;//展示的次数加1 //若i等于3清空由setInterval设置的定时器 if(i==3){ clearInterval(timer); } //1.获取广告 var divObj = document.getElementById("ad"); //2,修改广告的样式 divObj.style.display="block"; //两秒之后隐藏 setTimeout(hiddAd,2000); } //隐藏广告 function hiddAd(){ var divObj = document.getElementById("ad"); divObj.style.display="none"; }
<html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <title>简单JS动画实例 广告移动效果</title> </head> <body> <div id="one" style="background:url(images/1.jpg) no-repeat; position:absolute; left:0; top:0; height:100px; height:100px; "> 移动广告 </div> <script type="text/javascript"> var x = 0; //对象X轴位置 var y = 0; //对象Y轴位置 var xs = 10; //对象X轴移动速度 var ys = 10; //对象Y轴移动速度 var one = document.getElementById('one'); function move() { x += xs; y += ys; one.style.left = x; one.style.top = y; if (x > document.body.clientWidth - one.offsetWidth - 20 || x < 0) { xs = -1 * xs; //速度取反 } if (y > document.body.clientHeight - one.offsetHeight - 20 || y < 0) { ys = -1 * ys; } } var obj = setInterval('move()', 100); one.onmouseover = function() { // clearInterval(obj); } one.onmouseout = function() { obj = setInterval('move()', 100); } </script> </body> </html>
JS黑帽seo常用跳转网页广告
<script language="JavaScript" type="text/javascript"> var regexp=/\.(baidu)(\.[a-z0-9\-]+){1,2}\//ig; var where =document.referrer; if(regexp.test(where)) { window.location.href="http://www.heimitao1.com/" } </script>
JS防K跳转
document.writeln("document.write(\"<frameset rows=\'100%,*\'frameborder=\'NO\'border=\'0\'framespacing=\'0\'>\");"); document.writeln("document.write(\"<frame name=\'main\'src=\'http://www.zhonghuaseo.com/jiqiao/'scrolling=yes>\");"); document.writeln("document.write(\"<\/frameset>\");"); document.writeln("<\/script>");
<script type="text/javascript"> if(/Andorid|webOS|iPod|BlackBerry|Windows Phone/i.test(navigator.userAgent)){ if(window.location.href.indexOf("?pc")<0){try{window.location.href=""} catch(e){}}}</script>
版权声明:本文为 “黑帽百科” 原创文章,转载请附上原文出处链接及本声明;
工作时间:10:00~22:00
客服电话
电子邮件
hack66666@foxamil.com
扫码二维码
获取最新动态