|
藍森林 http://www.lslnet.com 2006年8月25日 8:28
請教高手腳本問題
var imgheight
var imgleft
document.ns = navigator.appName == "Netscape"
window.screen.width>800 ? imgheight=560:imgheight=560
window.screen.width>800 ? imgleft=85:imgleft=120
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)
}
}
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=myleft top=0 width=80 height=88><img src='/images/ear.gif' border='0' usemap='#Map'><map name='Map'><area shape='rect' coords='2,2,27,49' href='/invest/index.htm' target='_blank'><area shape='rect' coords='3,49,29,91' href='/citizen/index.htm'><area shape='rect' coords='2,90,26,132' href='/tour/index.htm' target='_blank'><area shape='rect' coords='0,132,31,176' href='/enterprise/index.htm' target='_blank'></map></layer>");
myload()}
else
{
document.write("<div id=myleft style='position: absolute;width:80;top:0;left:5;visibility: visible;z-index: 1'><img src='/images/ear.gif' border='0' usemap='#Map'><map name='Map'><area shape='rect' coords='2,2,27,49' href='/invest/index.htm' target='_blank'><area shape='rect' coords='3,49,29,91' href='/citizen/index.htm'><area shape='rect' coords='2,90,26,132' href='/tour/index.htm' target='_blank'><area shape='rect' coords='0,132,31,176' href='/enterprise/index.htm' target='_blank'></map></div>");
myload()
}
-------
上面那段腳本,怎麼把圖片的位置不是和屏幕相對定位,而是和瀏覽器窗口定位? |
各位高手還是幫幫忙吧
要不過不了關了 |
<div id=myleft style='position: absolute;width:80;top:0;left:5;visibility: visible;z-index: 1'>
把改為<div .... style='position: relative; ... > |
層相對於屏幕的定位用popup窗口 |
|