展开全部
把下面这段代码保存为 adver-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='swf/00001.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='swf/00001.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout wmode='transparent'></EMBED></div>");
myload()
}
把下面这段代码保存为 adver-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='swf/00001.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='swf/00001.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash'></EMBED></div>");
myload()
}
网页中是这样调用,注意修改 js 文件的路径
<SCRIPT src="js/adver-left.js"></SCRIPT>
<SCRIPT src="js/adver-right.js"></SCRIPT>
上面两段代码中的 src='swf/00001.swf' ,改为自己广告的flash的路径
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='swf/00001.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='swf/00001.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash' id=changhongout wmode='transparent'></EMBED></div>");
myload()
}
把下面这段代码保存为 adver-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='swf/00001.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='swf/00001.swf' quality=high WIDTH=80 HEIGHT=80 TYPE='application/x-shockwave-flash'></EMBED></div>");
myload()
}
网页中是这样调用,注意修改 js 文件的路径
<SCRIPT src="js/adver-left.js"></SCRIPT>
<SCRIPT src="js/adver-right.js"></SCRIPT>
上面两段代码中的 src='swf/00001.swf' ,改为自己广告的flash的路径
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询