flash随着网页移动一直居于网页底端的效果,希望大家以后能用的着。
先是右侧的js.命名为floatright.js
Quoted from Unkown:
document.ns = navigator.appName == "Microsoft Internet Explorer"
var imgheight
window.screen.width>800 ? imgheight=100:imgheight=100
function myload()
{
myright.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myright.style.left=document.body.offsetWidth-120;
mymove();
}
function mymove()
{
myright.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight;
myright.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(document.ns){
if(ad_float_right_type!="swf")
document.write("");
else
document.write("");
myload()
}
接着是左侧的,命名为floatleft.js
Quoted from Unkown:
document.ns = navigator.appName == "Microsoft Internet Explorer"
var imgleft
window.screen.width>800 ? imgheight=120:imgheight=120
window.screen.width>800 ? imgleft=0:imgleft=0
function myload()
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight
myleft.style.left=imgleft;
leftmove();
}
function leftmove()
{
myleft.style.top=document.body.scrollTop+document.body.offsetHeight-imgheight
myleft.style.left=imgleft;
setTimeout("leftmove();",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(document.ns){
if(ad_float_left_type!="swf")
document.write("");
else
document.write("");
myload()
}
最后是页面插入的JS
右:
左: