逐梦论坛's Archiver

shillan 发表于 2009-8-15 10:08

页面漂浮广告代码

<script>
function turnoff(obj){
document.getelementbyid(obj).style.display="none";
}
</script>
  
<div id="ad" style="position:absolute;z-index:10">
<a href="#">点击关闭</a><br>
<a href="[url=http://www.sfsfsfsf.com/about.asp?id=49]http://www.sfsfsfsf.com/about.asp?id=49[/url]" target="_blank"><img src="[url=http://www.sfsfsfsf.com/danbao.jpg]http://www.sfsfsfsf.com/danbao.jpg[/url]" border="0">
</a></div>
<div id="ad" style="position:absolute;z-index:11">
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getelementbyid("ad")
function floatad() {
var l=t=0
var r= document.body.clientwidth-obj.offsetwidth
var b = document.body.clientheight-obj.offsetheight
obj.style.left = x + document.body.scrollleft
obj.style.top = y + document.body.scrolltop
x = x + step*(xin?1:-1)
if (x < l) { xin = true; x = l}
if (x > r){ xin = false; x = r}
y = y + step*(yin?1:-1)
if (y < t) { yin = true; y = t }
if (y > b) { yin = false; y = b }
}
var itl= setinterval("floatad()", delay)
obj.onmouseover=function(){clearinterval(itl)}
obj.onmouseout=function(){itl=setinterval("floatad()", delay)}
</script>
</div>

shillan 发表于 2009-8-15 10:10

<script>
function turnoff(obj){
document.getelementbyid(obj).style.display="none";
}
</script>
  
<div id="ad" style="position:absolute;z-index:10">
<a href="#">点击关闭</a><br>
<a href="http://www.sfsfsfsf.com/about.asp?id=49" target="_blank"><img src="http://www.sfsfsfsf.com/danbao.jpg" border="0">
</a></div>
<div id="ad" style="position:absolute;z-index:11">
<script>
var x = 50,y = 60
var xin = true, yin = true
var step = 1
var delay = 10
var obj=document.getelementbyid("ad")
function floatad() {
var l=t=0
var r= document.body.clientwidth-obj.offsetwidth
var b = document.body.clientheight-obj.offsetheight
obj.style.left = x + document.body.scrollleft
obj.style.top = y + document.body.scrolltop
x = x + step*(xin?1:-1)
if (x < l) { xin = true; x = l}
if (x > r){ xin = false; x = r}
y = y + step*(yin?1:-1)
if (y < t) { yin = true; y = t }
if (y > b) { yin = false; y = b }
}
var itl= setinterval("floatad()", delay)
obj.onmouseover=function(){clearinterval(itl)}
obj.onmouseout=function(){itl=setinterval("floatad()", delay)}
</script>
</div>

lihaijun868 发表于 2009-8-16 22:31

dddddddddddddddddddddddddddd

馒头黄了 发表于 2012-1-25 23:03

谢谢啦,很有用!

qazwer168 发表于 2012-2-8 13:33

挺好啊挺好

诚澄博 发表于 2012-3-28 09:33

说的好啊!我在bbs打滚这么多年,所谓阅人无数,就算没有见过猪走路,也总明白猪肉是啥味道的

www.xauke.com 发表于 2012-7-22 13:46

谢谢楼主,真是太好了

www.lctzw.com 发表于 2012-7-30 10:13

支持你加分

www.dulady.com 发表于 2012-8-6 08:05

你加油吧!!!

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.