Javascript & Netscape

A

Adam

I have a scrollbar that runs at the top of my page, I have it in a external
js file and call it in the head tags of the webpage code. can you one tell
me how to get this code to work with other browsers mainly Netscape 7 and
above. Currently it doesn't display.

this is the scroll bar code

Thanks

----------------------------------------------------------------------
document.write('<marquee id="alertit"
style="position:absolute;left:0px;top:0;background-color:"
onMouseover="this.scrollAmount=1"
onMouseout="this.scrollAmount=speed"></marquee>');



var themsg='<span style="font: 22px Arial;color:#FFCC66;"><b>Text Text
Text:</span>'
var speed=4
var loops=4

function populatescroller(){
var windowwidth=iecompattest().clientWidth
document.getElementById("alertit").innerHTML=themsg
document.getElementById("alertit").style.width=windowwidth
document.getElementById("alertit").scrollAmount=speed
document.getElementById("alertit").scrollDelay=20
document.getElementById("alertit").loop=loops
document.getElementById("alertit").onfinish=function(){
document.getElementById("alertit").style.visibility="hidden"
}
}

function iecompattest(){
return (document.compatMode!="BackCompat")? document.documentElement :
document.body
}

if (document.all && document.getElementById){
window.onload=populatescroller
window.onresize=populatescroller
}
----------------------------------------------------------------------
 
M

Michael Schmitt

Adam said:
I have a scrollbar that runs at the top of my page, I have it in a external
js file and call it in the head tags of the webpage code. can you one tell
me how to get this code to work with other browsers mainly Netscape 7 and
above. Currently it doesn't display.

this is the scroll bar code

Thanks

----------------------------------------------------------------------
document.write('<marquee id="alertit"
style="position:absolute;left:0px;top:0;background-color:"
onMouseover="this.scrollAmount=1"
onMouseout="this.scrollAmount=speed"></marquee>'); background-color ?



var themsg='<span style="font: 22px Arial;color:#FFCC66;"><b>Text Text
Text:</span>'
var themsg=' said:
var speed=4 var speed=4;
var loops=4 var loops=4;

function populatescroller(){
var windowwidth=iecompattest().clientWidth
var windowwidth=iecompattest().clientWidth;
document.getElementById("alertit").innerHTML=themsg document.getElementById("alertit").innerHTML=themsg;
document.getElementById("alertit").style.width=windowwidth
document.getElementById("alertit").style.width=windowwidth + 'px';
document.getElementById("alertit").scrollAmount=speed document.getElementById("alertit").scrollAmount=speed;
document.getElementById("alertit").scrollDelay=20;
document.getElementById("alertit").loop=loops;
document.getElementById("alertit").onfinish=function(){
document.getElementById("alertit").style.visibility="hidden"
}
This is an unknown, or at least proprietary event and does not work in IE 6 SP1 and Moz. 1.7
http://groups.google.de/[email protected]&rnum=4
}

function iecompattest(){
return (document.compatMode!="BackCompat")? document.documentElement :
document.body
}
The next I changed to a function said:
if (document.all && document.getElementById){

only IE and Opera know the proprietary document.all
so e.g. Mozilla and Netscape don't come here
window.onload=populatescroller
window.onresize=populatescroller
}

function setupMarquee() {
if (document.all || document.getElementById){
window.onresize=populatescroller;
populatescroller();
} else {
alert('Browser !=IE Browser != Opera');
}
}

After correcting some mistakes this code is working in IE 6.0 SP1 and Mozilla 1,7, hopefully in Opera too.
But I would apologize to implement your 'scrollbar' with DHTML without the proprietary '<marquee>', or even better
with one of the free Java-applets.

cu, Michael
 
T

Thomas 'PointedEars' Lahn

Adam said:
I have a scrollbar that runs at the top of my page, [...]

You do not have a scrollbar (that is the GUI element to scroll the
document), you have horizontally scrolling text. For usabilities
sake, remove it. (Ask Google for details about "marquee".)


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top