reza77
12-01-2003, 12:51 AM
This code only seems to work in IE not netscape 4.7. I get a 'document.vscroller01 undefined' error. Can someone pls help me out. If the code is not meant to work with netscape can someone pls tell me where i can get a cross browser script.
<br/>
<script LANGUAGE="JavaScript1.2">
//change the scrollers contents
//var headlines='<font face="Arial" color="black" size="1">'+amwatch_headline+'<BR><BR>'+other_headlines+'</font>';
var headlines='<font face="Arial" color="black" size="1">'+other_headlines+'</font>';
//change the scrollers width (in pixels)
var scrollerwidth=200;
//change the scrollers height
var scrollerheight=135;
//change the scrollers scroll speed (larger is faster)
var speed=1;
if (document.all)
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+scrollerwidth+';height:'+scrollerheight+'">'+headlines+'</marquee>');
function regenerate(){
window.location.reload();
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate()",450);
intializescroller();
}
}
function intializescroller(){
document.vscroller01.document.vscroller02.document.write(headlines);
document.vscroller01.document.vscroller02.document.close();
thelength=document.vscroller01.document.vscroller02.document.height;
scrollit();
}
function scrollit(){
if (document.vscroller01.document.vscroller02.top>=thelength*(-1)){
document.vscroller01.document.vscroller02.top-=speed;
setTimeout("scrollit()",100);
}
else{
document.vscroller01.document.vscroller02.top=scrollerheight;
scrollit();
}
}
window.onload=regenerate2();
</script>
<ilayer name="vscroller01" width=&{scrollerwidth}; height=&{scrollerheight};>
<layer name="vscroller02" width=&{scrollerwidth}; height=&{scrollerheight};></layer>
</ilayer>
<br/>
<br/>
<script LANGUAGE="JavaScript1.2">
//change the scrollers contents
//var headlines='<font face="Arial" color="black" size="1">'+amwatch_headline+'<BR><BR>'+other_headlines+'</font>';
var headlines='<font face="Arial" color="black" size="1">'+other_headlines+'</font>';
//change the scrollers width (in pixels)
var scrollerwidth=200;
//change the scrollers height
var scrollerheight=135;
//change the scrollers scroll speed (larger is faster)
var speed=1;
if (document.all)
document.write('<marquee direction="up" scrollAmount='+speed+' style="width:'+scrollerwidth+';height:'+scrollerheight+'">'+headlines+'</marquee>');
function regenerate(){
window.location.reload();
}
function regenerate2(){
if (document.layers){
setTimeout("window.onresize=regenerate()",450);
intializescroller();
}
}
function intializescroller(){
document.vscroller01.document.vscroller02.document.write(headlines);
document.vscroller01.document.vscroller02.document.close();
thelength=document.vscroller01.document.vscroller02.document.height;
scrollit();
}
function scrollit(){
if (document.vscroller01.document.vscroller02.top>=thelength*(-1)){
document.vscroller01.document.vscroller02.top-=speed;
setTimeout("scrollit()",100);
}
else{
document.vscroller01.document.vscroller02.top=scrollerheight;
scrollit();
}
}
window.onload=regenerate2();
</script>
<ilayer name="vscroller01" width=&{scrollerwidth}; height=&{scrollerheight};>
<layer name="vscroller02" width=&{scrollerwidth}; height=&{scrollerheight};></layer>
</ilayer>
<br/>