漂浮图片

<SCRIPT language=JavaScript>
<!--
document.write("<div id='img' style='POSITION: absolute;z-index:20; right: 20px; top: 3px><table border='0' width='200'><tr><td align='center'><a href='图片链接' target=_blank><img src='图片路径' border='0'></a></td></tr></table></div>")
window.οnlοad=img;
var xPos = 20;
var yPos = document.body.clientHeight;
var step = 1;
var delay = 30;<wbr><wbr><br> var height = 0;<br> var Hoffset = 0;<br> var Woffset = 0;<br> var yon = 0;<br> var xon = 0;<br> var pause = true;<br> var interval;<br> img.style.top = yPos;<br> function changePos() {<br> width = document.body.clientWidth;<br> height = document.body.clientHeight;<br> Hoffset = img.offsetHeight;<br> Woffset = img.offsetWidth;<br> img.style.left = xPos + document.body.scrollLeft;<br> img.style.top = yPos + document.body.scrollTop;<br> if (yon) {<br> yPos = yPos + step;<br> }<br> else {<br> yPos = yPos - step;<br> }<br> if (yPos &lt; 0) {<br> yon = 1;<br> yPos = 0;<br> }<br> if (yPos &gt;= (height - Hoffset)) {<br> yon = 0;<br> yPos = (height - Hoffset);<br> }<br> if (xon) {<br> xPos = xPos + step;<br> }<br> else {<br> xPos = xPos - step;<br> }<br> if (xPos &lt; 0) {<br> xon = 1;<br> xPos = 0;<br> }<br> if (xPos &gt;= (width - Woffset)) {<br> xon = 0;<br> xPos = (width - Woffset);<br> }<br> }<br> function start() {<br> img.visibility ="visible";<br> interval = setInterval('changePos()', delay);<br> }<br> start();<br> // --&gt;</wbr></wbr>

</SCRIPT>

©️2020 CSDN 皮肤主题: 大白 设计师: CSDN官方博客 返回首页
实付0元
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值