漂浮广告位代码

date:星期三, 九月 30th, 2009 at 4:21 下午 Categories:web

保留下。。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
<div id="qfclub" style="position:absolute;"> <a href="http://qfclub.qphome.com/user/album.php" target="_blank"><img src="http://qfclub.qphome.com/wp-content/themes/shfsy/images/5321705.gif" border="0"></a></div>
<script> 
var x = 50,y = 60 
var xin = true, yin = true 
var step = 1 
var delay = 8 
var obj=document.getElementById("qfclub") 
function qfclub() { 
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("qfclub()", delay) 
obj.onmouseover=function(){clearInterval(itl)} 
obj.onmouseout=function(){itl=setInterval("qfclub()", delay)} 
</script>

One Response to “漂浮广告位代码”

  1. NyannaNo Gravatar

    Articles like these put the cosnmuer in the driver seat-very important.

    [Reply]

Leave a Reply