Click to See Complete Forum and Search --> : vertical scroller


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/>

Pittimann
12-01-2003, 03:22 AM
Hi!

Using <marquee>blah</marquee> can never be cross browser compatible!

Not knowing what you actually want to use this scroll for, just a general hint-

Check out this: http://javascript.internet.com/scrolls/

There a quite a lot of scroll scripts to be found there some of which also work with browsers other than IE...

Cheers - Pit

reza77
12-03-2003, 01:02 AM
Thanks for the link Pit. It helped me find what i was looking for.