灰儿 发表于 2008-3-10 09:24:18

浮动图片代码(网页浮动广告图片)

&lt;div id="img" style="position:absolute;"&gt; <br />&lt;a href="<img src="http://www.venshop.com/book/images/url.gif" align=absMiddle /><a target=_blank href="http://www.freedown.net/%22" target=_blank>http://www.freedown.net/"</a>; target="_blank"&gt; <br />&lt;img src="<img src="http://www.venshop.com/book/images/url.gif" align=absMiddle /><a target=_blank href="http://www.freedown.net/logo.gif%22" target=_blank>http://www.freedown.net/logo.gif"</a>; border="0"&gt;&lt;/a&gt; <br />&lt;/div&gt; <br /><br />&lt;SCRIPT LANGUAGE="JavaScript"&gt; <br />&lt;!-- <br />var xPos = 20; <br />var yPos = document.body.clientHeight; <br />var step = 1; <br />var delay = 30; <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 www_helpor_net() { <br />img.visibility = "visible"; <br />interval = setInterval(&#39;changePos()&#39;, delay); <br />} <br />www_helpor_net(); <br />//For more,visit:www.helpor.net <br />--&gt; <br />&lt;/script&gt;<br />
页: [1]
查看完整版本: 浮动图片代码(网页浮动广告图片)