CSDN博客

img chenlianjia

JS广告跟随效果

发表于2004/9/25 16:28:00  1018人阅读

分类: .NET心得

先建一个JS文件把如下内容考进去
var imgheight
window.screen.width>800 ? imgheight=315:imgheight=315
function myload()
{
ctw.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight-100;
ctw.style.left=document.body.offsetWidth-1300;
mymove();
}
 function mymove()
 {
 ctw.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight-100;
 ctw.style.left=document.body.scrollLeft+document.body.offsetWidth-130;
 setTimeout("mymove();",50)
 }

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true)


document.write("<div id=ctw style='position: absolute;width:106;top:0;left:560;visibility: visible;z-index: 1'><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='100' height='100'><param name='movie' value='0492501.swf'><param name='quality' value='high'><embed src='0492501.swf' quality='high' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' width='100' height='100'></embed></object></div>");
myload()
这个层里面的是FLASH,也可以是一个图片,或者其他的元素
在<body>下边放置如下语句就可以了(特别注意路径要写对):<SCRIPT language=javascript1.1
src="/js/JS名字.js"></SCRIPT>

阅读全文
0 0

相关文章推荐

img
取 消
img