网站上飘来飘去的浮动广告,可以是FLASH格式吗?我想知道代码设置.
參考答案:第一个:
<script language="vbscript">
window.moveto 0,0
window.resizeto 100,100
wx=0
wy=0
dim tid
function mywindows()
if wx<window.screen.width-100 then
wx=wx+10
window.moveto wx,0
else
if wy<window.screen.width-100 then
wy=wy+10
window.move window.screen.width-100,wy
end if
end if
end function
tid=setinterval("mywindows()",10)
</script>
第2个:
<DIV id=ad style="POSITION: absolute"><A href=""
target=_blank><IMG src="leifeng.gif" 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>
加在那都可以运行,最好加在<head></head>中间。