制作弹性飘动的FLASH广告

      让工作更简单 2006-3-9 10:49
<script language="javascript">
<!--
var Xpos = 0;
var Ypos = 0;
var Ygravity = 0.9;
var scrollPos = 0;
var oldScrollPos = 0;


function FloatMenu() {
docWidth = 700; // update document width
docHeight = document.body.clientHeight; // update document height
oldScrollPos = scrollPos;
scrollPos = document.body.scrollTop; // update scrollbar position
//if(scrollPos > 600) scrollPos = 580;

Xpos = docWidth;
Yboundary = scrollPos + 400;

if (floater.offsetTop < Yboundary - 10) // Object is behind boundary
Ypos += 3;

if (floater.offsetTop > Yboundary + 10) // Object is past boundary
Ypos -= 3;

Ypos *= Ygravity; // Slow object down

floater.style.pixelLeft = Xpos + 130;
floater.style.pixelTop += Ypos; // Make object bounce
}

window.setInterval("FloatMenu()", 30);

//-->
</script>
<div id=floater border="0">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="120" height="120">
<param name="movie" value="sxlg_images/no/flash_2006_ketangjiacha.swf">
<param name="quality" value="high"><param name="wmode" value="transparent">
<embed src="*****(这里写入你的FLASH文件名).swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="120" height="120"></embed>
</object>
</div>
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}