复制代码 代码如下:
#zealNavigatorBar{
position:absolute;
z-index:100;
width:760px;
height:32px;
line-height:32px;
top:0px;
left:0px;
padding:0px;
margin:0px;
border-bottom:1pxsolid#646465;
background-color:#C0C0C3;
}
');
varg_myBodyInstance=document.body;
varg_myBodyInstanceString="document.body";
if(document.compatMode!="BackCompat"){
//forlooser.dtd
g_myBodyInstance=document.documentElement;
g_myBodyInstanceString="document.documentElement";
}
varisMinNS4=(navigator.appName.indexOf("Netscape")>=0&&
parseFloat(navigator.appVersion)>=4)?1:0;
varisMinNS5=(navigator.appName.indexOf("Netscape")>=0&&
parseFloat(navigator.appVersion)>=5)?1:0;
varisMinIE4=(document.all)?1:0;
varisMinIE5=(isMinIE4&&navigator.appVersion.indexOf("5.")>=0)?1:0;
varisMacIE=(isMinIE4&&navigator.userAgent.indexOf("Mac")>=0)?1:0;
vargetFFVersion=navigator.userAgent.substring(
navigator.userAgent.indexOf("Firefox")).split("/")[1];
//extraheightinpxtoaddtoiframeinFireFox1.0+browsers
varFFextraHeight=getFFVersion<1.5?16:0;
functiongetLayer(name){
if(isMinNS5)
returndocument.getElementById(name);
elseif(isMinIE4)
returneval('document.all.'+name);
elseif(isMinNS4)
returnfindLayer(name,document);
returnnull;
}
functionfindLayer(name,doc){
vari,layer;
for(i=0;i
if(layer.name==name)
returnlayer;
if(layer.document.layers.length>0){
layer=findLayer(name,layer.document);
if(layer!=null)
returnlayer;
}
}
returnnull;
}
functionmoveLayerTo(layer,x,y){
if(isMinIE4){
layer.style.left=x;
layer.style.top=y;
}
elseif(isMinNS5){
layer.style.left=x+'px';
layer.style.top=y+'px';
}
elseif(isMinNS4)
layer.moveTo(x,y);
}
functiongetPageLeft(layer){
if(isMinIE4||isMinNS5)
return(layer.offsetLeft);
elseif(isMinNS4)
return(layer.pageX);
return(-1);
}
functiongetPageTop(layer){
if(isMinIE4||isMinNS5)
return(layer.offsetTop);
elseif(isMinNS4)
return(layer.pageY);
return(-1);
}
functiongetPageScrollX(){
if(isMinIE4||isMinNS5)
return(g_myBodyInstance.scrollLeft);
elseif(isMinNS4)
return(window.pageXOffset);
return(-1);
}
functiongetPageScrollY(){
if(isMinIE4||isMinNS5)
return(g_myBodyInstance.scrollTop);
elseif(isMinNS4)
return(window.pageYOffset);
return(-1);
}
varg_p_zealNavigatorBar=null;
g_p_zealNavigatorBar=getLayer('zealNavigatorBar');
if(!isMinIE4){g_p_zealNavigatorBar.style.position='fixed';}
functionreposzealNavigatorBar(){
if(isMinIE4){
try{
moveLayerTo(g_p_zealNavigatorBar,
getPageLeft(g_p_zealNavigatorBar),
getPageScrollY());
}catch(e){}
}
}
window.onresize=reposzealNavigatorBar;
window.onscroll=reposzealNavigatorBar;
window.onload=reposzealNavigatorBar;