this one scrolls up and down, and is easy to use, i have used it before....if u just want it to scroll down then i bet u can just take out all of the function scrolls up... (this code is free to use and u can edit it too):
// ASM SCROLLER 2.0 - (c) 2000 Brent Gustafson, vitaflo.com and assembler.org
//
// Feel free to hack around with this code for personal use, it's open source
// so do what ya want w/ it. Though a link would be nice. ;) While this code
// doesn't have a ton of documentation, please remember that I am a busy man,
// so support of this code will be very minimal. Use at your own risk.
//
// Follow me into a solo, get in the FLO
// And you can picture like a photo
// Music mixed mellow maintains to make
// Melodies for MC's motivates the breaks
// I'm everlasting, I can go on for days and days
// With rhyme displays that engrave deep as X-rays
//
// -Brent (brent@assembler.org)
// assembler.org || vitaflo.com
var w3c = (document.getElementById) ? 1:0
var ns4 = (document.layers) ? 1:0
var ie4 = (document.all) ? 1:0
var range = "";
var cap = "";
var mutex = 0;
var yplace = 0;
var ymax = 0;
var ymin = 0;
var xplace = 0;
var newsHeight = 0;
/** The only code you should ever need to change here are the following 3 vars **/
var speed = 4; //speed at which the news scrolls
var newsId = "news"; //name of the overall news div
var newsClipId = "newsClipping"; //name of the news clipping div
function redrawScreen() {
location.reload();
return false
}
function shiftTo(obj, x, y) {
if (w3c) {
obj.style.left = x + "px";
obj.style.top = y + "px";
}
else if (ns4) {
obj.moveTo(x,y);
}
else if (ie4) {
obj.style.pixelLeft = x;
obj.style.pixelTop = y;
}
}
function getObject(obj) {
var theObj = eval("document." + range + obj + cap);
return theObj;
}
function scrollUp() {
if (mutex == 1){
var theObj = getObject(newsId);
if (yplace < ymax) {
yplace = yplace + speed;
if (yplace > ymax) yplace = ymax;
shiftTo(theObj, xplace, yplace);
setTimeout("scrollUp()",25
}
}
}
function scrollDown() {
if (mutex == 2){
var theObj = getObject(newsId);
if (yplace > ymin) {
yplace = yplace - speed;
if (yplace < ymin) yplace = ymin;
shiftTo(theObj, xplace, yplace);
setTimeout("scrollDown()",
}
}
}
function scrollIt(msg, dir) {
window.status = msg;
mutex = dir;
if (mutex == 1) scrollUp();
else if (mutex == 2) scrollDown();
}
function init() {
if (w3c) {
range = "getElementById(\"";
cap = "\")";
theObj = getObject(newsClipId);
newsHeight = parseInt(theObj.offsetHeig
theObj = getObject(newsId);
ymin = (parseInt(theObj.offsetHei
}
else if (ns4) {
window.captureEvents(Event
window.onresize = redrawScreen;
theObj = getObject(newsClipId);
newsHeight = theObj.clip.height;
newsId = newsClipId + ".document." + newsId;
theObj = getObject(newsId);
ymin = (theObj.clip.height - newsHeight) * -1;
}
else if (ie4) {
range = "all.";
theObj = getObject(newsClipId);
newsHeight = theObj.offsetHeight;
theObj = getObject(newsId);
ymin = (theObj.offsetHeight - newsHeight) * -1;
}
}
// END OF LINE
the script is called ASM_Scroller2.js
here is an example of it in action from the guys site: http://architecture.mit.ed
Main Topics
Browse All Topics





by: jyokumPosted on 2003-06-11 at 06:55:20ID: 8699760
this one scrolls up but probably wouldn't be too hard to reverse.
m
/
d
=5){ ,4000) .main.docu ment.secon d)",4000) nt.height* -1){ ,100) erheight) ages[i])
p<=5){ ",4000) .main.docu ment.first )",4000) ment.heigh t*-1){ ",100) lerheight) sages[i])
0&&parseIn t(tdiv.sty le.top)<=5 ){ 000) obj)",4000 ) =tdiv.offs etHeight*- 1){ iv.style.t op)-5+"px" 00) rollerheig ht)
>0&&parseI nt(tdiv2.s tyle.top)< =5){ 4000) bj)",4000) >=tdiv2.of fsetHeight *-1){ div2.style .top)-5+"p x" obj)",100) crollerhei ght) ]
irst2") econd2") llerheight ty='visibl e' show' nt.first) ond.top=pa rseInt(scr ollerheigh t)+5 ond.visibi lity='show '
; background=&{scrollerbackg round}; visibility=hide> ) ndetermine =(messages .length==1 )? 0 : 1])
idth:'+scr ollerwidth +';height: '+scroller height+';o verflow:hi dden;backg round-colo r:'+scroll erbgcolor+ ' ;background-image:url('+sc rollerback ground+')" >') idth:'+scr ollerwidth +';height: '+scroller height+';c lip:rect(0 '+scrollerwidth+' '+scrollerheight+' 0);left:0px;top:0px">') idth:'+scr ollerwidth +';left:0p x;top:1px; ">') ) idth:'+scr ollerwidth +';left:0p x;top:0px; visibility :hidden">' ) ndetermine =(messages .length==1 )? 0 : 1])
<style>
.scroll_header { font-size:10px; }
</style>
<script language="JavaScript1.2">
/*
Pausing updown message scroller-
© Dynamic Drive (www.dynamicdrive.com)
For full source code, installation instructions,
Terms Of Use, visit http://www.dynamicdrive.co
*/
//configure the below five variables to change the style of the scroller
var scrollerwidth='450px'
var scrollerheight='50px'
var scrollerbgcolor='white'
//set below to '' if you don't wish to use a background image
var scrollerbackground=''
//configure the below variable to change the contents of the scroller
var messages=new Array()
messages[0]="<img src='/help.gif'>"
messages[1]="<img src='/mmc.gif'>"
messages[2]="<img src='/print.gif'>"
///////Do not edit pass this line//////////////////////
var ie=document.all
var dom=document.getElementByI
if (messages.length>2)
i=2
else
i=0
function move1(whichlayer){
tlayer=eval(whichlayer)
if (tlayer.top>0&&tlayer.top<
tlayer.top=0
setTimeout("move1(tlayer)"
setTimeout("move2(document
return
}
if (tlayer.top>=tlayer.docume
tlayer.top-=5
setTimeout("move1(tlayer)"
}
else{
tlayer.top=parseInt(scroll
tlayer.document.write(mess
tlayer.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move2(whichlayer){
tlayer2=eval(whichlayer)
if (tlayer2.top>0&&tlayer2.to
tlayer2.top=0
setTimeout("move2(tlayer2)
setTimeout("move1(document
return
}
if (tlayer2.top>=tlayer2.docu
tlayer2.top-=5
setTimeout("move2(tlayer2)
}
else{
tlayer2.top=parseInt(scrol
tlayer2.document.write(mes
tlayer2.document.close()
if (i==messages.length-1)
i=0
else
i++
}
}
function move3(whichdiv){
tdiv=eval(whichdiv)
if (parseInt(tdiv.style.top)>
tdiv.style.top=0+"px"
setTimeout("move3(tdiv)",4
setTimeout("move4(second2_
return
}
if (parseInt(tdiv.style.top)>
tdiv.style.top=parseInt(td
setTimeout("move3(tdiv)",1
}
else{
tdiv.style.top=parseInt(sc
tdiv.innerHTML=messages[i]
if (i==messages.length-1)
i=0
else
i++
}
}
function move4(whichdiv){
tdiv2=eval(whichdiv)
if (parseInt(tdiv2.style.top)
tdiv2.style.top=0+"px"
setTimeout("move4(tdiv2)",
setTimeout("move3(first2_o
return
}
if (parseInt(tdiv2.style.top)
tdiv2.style.top=parseInt(t
setTimeout("move4(second2_
}
else{
tdiv2.style.top=parseInt(s
tdiv2.innerHTML=messages[i
if (i==messages.length-1)
i=0
else
i++
}
}
function startscroll(){
if (ie||dom){
first2_obj=ie? first2 : document.getElementById("f
second2_obj=ie? second2 : document.getElementById("s
move3(first2_obj)
second2_obj.style.top=scro
second2_obj.style.visibili
}
else if (document.layers){
document.main.visibility='
move1(document.main.docume
document.main.document.sec
document.main.document.sec
}
}
window.onload=startscroll
</script>
<ilayer id="main" width=&{scrollerwidth}; height=&{scrollerheight}; bgColor=&{scrollerbgcolor}
<layer id="first" left=0 top=1 width=&{scrollerwidth};>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[0]
</script>
</layer>
<layer id="second" left=0 top=0 width=&{scrollerwidth}; visibility=hide>
<script language="JavaScript1.2">
if (document.layers)
document.write(messages[dy
</script>
</layer>
</ilayer>
<script language="JavaScript1.2">
if (ie||dom){
document.writeln('<div id="main2" style="position:relative;w
document.writeln('<div style="position:absolute;w
document.writeln('<div id="first2" style="position:absolute;w
document.write(messages[0]
document.writeln('</div>')
document.writeln('<div id="second2" style="position:absolute;w
document.write(messages[dy
document.writeln('</div>')
document.writeln('</div>')
document.writeln('</div>')
}
</script>