473,326 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Javascript & Netscape

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=thems g
document.getElementById("alertit").style.width=win dowwidth
document.getElementById("alertit").scrollAmount=sp eed
document.getElementById("alertit").scrollDelay=20
document.getElementById("alertit").loop=loops
document.getElementById("alertit").onfinish=functi on(){
document.getElementById("alertit").style.visibilit y="hidden"
}
}

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

if (document.all && document.getElementById){
window.onload=populatescroller
window.onresize=populatescroller
}
----------------------------------------------------------------------
Jul 23 '05 #1
2 2147
Adam wrote:
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='<span style="font: 22px Arial;color:#FFCC66;font-weight:bold">Text Text Text:</span>'; 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=thems g document.getElementById("alertit").innerHTML=thems g; document.getElementById("alertit").style.width=win dowwidth document.getElementById("alertit").style.width=win dowwidth + 'px'; document.getElementById("alertit").scrollAmount=sp eed document.getElementById("alertit").scrollAmount=sp eed; document.getElementById("alertit").scrollDelay=20 document.getElementById("alertit").scrollDelay=20; document.getElementById("alertit").loop=loops document.getElementById("alertit").loop=loops; document.getElementById("alertit").onfinish=functi on(){
document.getElementById("alertit").style.visibilit y="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/groups?q=onfinish+group:comp.lang.javascript&hl=de &lr=lang_de|lang_en&ie=UTF-8&group=comp.lang.javascript&selm=LQQk4.855%24hT2. 11777%40news1.rdc1.ct.home.com&rnum=4 }

function iecompattest(){
return (document.compatMode!="BackCompat")? document.documentElement :
document.body
}
The next I changed to a function, which is called by <body onload="setupMarquee();">
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
Jul 23 '05 #2
Adam wrote:
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
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Smriti Dev | last post by:
Hi, I have a drop down menu with a listing of communities and I use it to select a community, selecting a letter ie. "T" , I get bumped to the "T" section to choose communities that start with...
5
by: Florian Proch | last post by:
Hi all... i'm currently working for a big project to construct a website. We need to support some browser and OS : IE 5.0 -> IE 6, Mozilla 1.2 -> 1.7, Opera 5 -> Opéra 7.5x, Netscape 4.75 -> NS...
2
by: Jamiil | last post by:
This is the first time I am ever using JavaScript, I am not even eloquent in HTML, and all I am is someone who has Microsoft/Netscape Webpage developers. What I am trying to say is that I am not an...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.