浮动图片代码(网页浮动广告图片)
<div id="img" style="position:absolute;"> <br /><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"> <br /><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"></a> <br /></div> <br /><br /><SCRIPT LANGUAGE="JavaScript"> <br /><!-- <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 < 0) { <br />yon = 1; <br />yPos = 0; <br />} <br />if (yPos >= (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 < 0) { <br />xon = 1; <br />xPos = 0; <br />} <br />if (xPos >= (width - Woffset)) { <br />xon = 0; <br />xPos = (width - Woffset); <br />} <br />} <br />function www_helpor_net() { <br />img.visibility = "visible"; <br />interval = setInterval('changePos()', delay); <br />} <br />www_helpor_net(); <br />//For more,visit:www.helpor.net <br />--> <br /></script><br />
页:
[1]