ehout
asked on
cross browser ticker.
Hi,
On my employer's website (www.levob.nl) I have a scrolling text in the upper right corner. To bad it only seems to run in IE (Mozilla Firebird complains about errors). Can anybody help in making this script cross browser compatible?
--------Begin code------------
<table width="350" border="0" align="right">
<tr>
<td>
<script language="JavaScript1.2">
var marqueewidth=300
var marqueeheight=20
var speed=5
var marqueecontents='<font face="verdana" font size=-2>Wegens technische werkzaamheden zijn de Levob websites donderdag 22 april van 18:00 uur tot 22:00 uur niet beschikbaar! Onze excuses voor het ongemak.</font>'
if (document.all)
document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidt h+'">'+mar queeconten ts+'</marq uee>')
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresiz e=regenera te",450)
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.docume nt.cmarque e02.docume nt.write(' <nobr>'+ma rqueeconte nts+'</nob r>')
document.cmarquee01.docume nt.cmarque e02.docume nt.close()
thelength=document.cmarque e01.docume nt.cmarque e02.docume nt.width
scrollit()
}
function scrollit(){
if (document.cmarquee01.docum ent.cmarqu ee02.left> =thelength *(-1)){
document.cmarquee01.docume nt.cmarque e02.left-= speed
setTimeout("scrollit()",10 0)
}
else{
document.cmarquee01.docume nt.cmarque e02.left=m arqueewidt h
scrollit()
}
}
window.onload=regenerate2
</script></td>
</tr>
</table>
<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer>
</ilayer>
--------End code-------
Thanx in advance
Kind regards
On my employer's website (www.levob.nl) I have a scrolling text in the upper right corner. To bad it only seems to run in IE (Mozilla Firebird complains about errors). Can anybody help in making this script cross browser compatible?
--------Begin code------------
<table width="350" border="0" align="right">
<tr>
<td>
<script language="JavaScript1.2">
var marqueewidth=300
var marqueeheight=20
var speed=5
var marqueecontents='<font face="verdana" font size=-2>Wegens technische werkzaamheden zijn de Levob websites donderdag 22 april van 18:00 uur tot 22:00 uur niet beschikbaar! Onze excuses voor het ongemak.</font>'
if (document.all)
document.write('<marquee scrollAmount='+speed+' style="width:'+marqueewidt
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresiz
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.docume
document.cmarquee01.docume
thelength=document.cmarque
scrollit()
}
function scrollit(){
if (document.cmarquee01.docum
document.cmarquee01.docume
setTimeout("scrollit()",10
}
else{
document.cmarquee01.docume
scrollit()
}
}
window.onload=regenerate2
</script></td>
</tr>
</table>
<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer>
</ilayer>
--------End code-------
Thanx in advance
Kind regards
ASKER
Thanx for the quickt replay.
Got it this way from an acquintance, so did not know the origin. However, the script is only used for a couple of days once a while to display a notification of maintenance to our customers.
But unfortunately the script still does not seem to work outside IE?
Kind regards
Got it this way from an acquintance, so did not know the origin. However, the script is only used for a couple of days once a while to display a notification of maintenance to our customers.
But unfortunately the script still does not seem to work outside IE?
Kind regards
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanx for the reminder.
Kind regards.
Kind regards.
Anyway, here's a minimum change version which should be okay in Firefox (suggest you leave the credit in).
<table width="350" border="0" align="right">
<tr>
<td>
<script language="JavaScript1.2">
/*
Cross browser marquee script
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
Modified by apprenti
(https://www.experts-exchange.com/Web/Web_Languages/JavaScript/M_1163695.html) to work in Gecko
*/
var marqueewidth=300
var marqueeheight=20
var speed=5
var marqueecontents='<font face="verdana" font size=-2>Please do not remove copyright and credit
notices from scripts. Thank you.</font>'
if (document.getElementById && !window.opera)
document.write('<marquee scrollAmount='+speed+'
style="width:'+marqueewidt
function regenerate(){
window.location.reload()
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresiz
intializemarquee()
}
}
function intializemarquee(){
document.cmarquee01.docume
document.cmarquee01.docume
thelength=document.cmarque
scrollit()
}
function scrollit(){
if (document.cmarquee01.docum
document.cmarquee01.docume
setTimeout("scrollit()",10
}
else{
document.cmarquee01.docume
scrollit()
}
}
window.onload=regenerate2
</script></td>
</tr>
</table>
<ilayer width=&{marqueewidth}; height=&{marqueeheight}; name="cmarquee01">
<layer name="cmarquee02"></layer>
</ilayer>