phpnewer066
新手上路

UID 79256
精华
0
积分 20
帖子 13
金钱 20 喜悦币
威望 0
人脉 0
阅读权限 10
注册 2006-8-29
状态 离线
|
用js文件写的左右浮动广告效果怎么会这样?
请各位指点: 
我想做网页上左右浮动的广告,我在网上copy的一段代码,左边的部分效果很好,右边的却得将水平滚动条拖到最右边才看得到广告,这样很不方便,请问是哪里我需要改动一下,才能使得一打开网页这两边的广告就能出现?谢谢!
代码如下:
---------------------------------左边的 left.js-------------------------------------------
var imgheight
var imgleft
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=100:imgheight=100
window.screen.width>800 ? imgleft=15:imgleft=122
function myload()
{
if (navigator.appName == "Netscape")
{document.myleft.pageY=pageYOffset+window.innerHeight-imgheight;
document.myleft.pageX=imgleft;
leftmove();
}
else
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myleft.style.left=imgleft;
leftmove();
}
}
function leftmove()
{
if(document.ns)
{
document.myleft.top=pageYOffset+window.innerHeight-imgheight
document.myleft.left=imgleft;
setTimeout("leftmove();",80)
}
else
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myleft.style.left=imgleft;
setTimeout("leftmove();",80)
}
}
if (navigator.appName == "Netscape")
{
document.write(
"<layer id=myleft top=300 width=80 height=88><EMBED src='images/ad/9-5-1.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout wmode='transparent'></EMBED></layer>");
myload()}
else
{
document.write(
"<div id=myleft style='position: absolute;width:80;top:150;left:5;visibility: visible;z-index: 1'><EMBED src='images/ad/9-5-1.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongoutwmode='transparent'></EMBED></div>");
myload()
}
---------------------------------右边的 right.js-------------------------------------------
var imgheight
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=100:imgheight=100
function myload()
{
if (navigator.appName == "Netscape")
{document.dangdang.pageY=pageYOffset+window.innerHeight-imgheight;
document.dangdang.pageX=+window.innerWidth-120;
mymove();
}
else
{
dangdang.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
dangdang.style.left=document.body.offsetWidth-120;
mymove();
}
}
function mymove()
{
if(document.ns)
{
document.dangdang.top=pageYOffset+window.innerHeight-imgheight;
document.dangdang.left=pageXOffset+window.innerWidth-120;
setTimeout("mymove();",50)
}
else
{
dangdang.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
dangdang.style.left=document.body.scrollLeft+document.body.offsetWidth-120;
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)
if (navigator.appName == "Netscape")
{document.write(
"<layer id=dangdang top=300 width=80 height=88><EMBED src='images/ad/9-5-1.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash'></EMBED></layer>");
myload()}
else
{
document.write(
"<div id=dangdang style='position: absolute;width:80;top:0;left:578;visibility: visible;z-index: 1'><EMBED src='images/ad/9-5-1.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash'></EMBED></div>");
myload()
}
|
|