关于FrontPage2003
- 提问者网友:绫月
- 2021-07-24 21:43
- 五星知识达人网友:荒野風
- 2021-07-24 21:48
切换到代码区输入以下代码:
<div id="ad" style="position:absolute">
<a href="漂浮图片的连接地址" target="_blank">
<img src="漂浮图片的样式地址" border="0">
</a></div>
<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>