astro_sk
10-01-2003, 06:31 PM
ok I have a layer called staticbanner
I want it to stay in the top left corner at all times including page scroll. The script below works in ie but not netscape or mozzila.
var setleft=0
var offsettop=0
var ns4=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
if (ie4) {staticbanner.style.pixelTop=document.body.scrollTop+offsettop;
staticbanner.style.pixelLeft=document.body}
else if (ns6) {document.getElementById("staticbanner").style.top=window.pageYOffset+offsettop;
document.getElementById("staticbanner").style.left=window.pageXOffset}
else if (ns4) {eval(document.staticbanner.top=eval(window.pageYOffset+offsettop));
eval(document.staticbanner.left=eval(window.pageXOffset))}
else{document.getElementById("staticbanner").style.top=window.pageYOffset+offsettop;
document.getElementById("staticbanner").style.left=window.pageXOffset}
any ideas? oh by the way I can not use the setTimeout as it causes a problem with my other scripts.....
thanx in advance
I want it to stay in the top left corner at all times including page scroll. The script below works in ie but not netscape or mozzila.
var setleft=0
var offsettop=0
var ns4=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0
if (ie4) {staticbanner.style.pixelTop=document.body.scrollTop+offsettop;
staticbanner.style.pixelLeft=document.body}
else if (ns6) {document.getElementById("staticbanner").style.top=window.pageYOffset+offsettop;
document.getElementById("staticbanner").style.left=window.pageXOffset}
else if (ns4) {eval(document.staticbanner.top=eval(window.pageYOffset+offsettop));
eval(document.staticbanner.left=eval(window.pageXOffset))}
else{document.getElementById("staticbanner").style.top=window.pageYOffset+offsettop;
document.getElementById("staticbanner").style.left=window.pageXOffset}
any ideas? oh by the way I can not use the setTimeout as it causes a problem with my other scripts.....
thanx in advance