b3b logo

contents graphic 

web site policy

your birthday today?

Search results take a few seconds and open in a  new window. May need to allow Pop Ups to see results.

Brownielocks and The 3 Bears
present

Java Script for
 Auto-Scrolling or
 Self-Scrolling  Vertical Text
on a Fixed Background.

We made a sample page so you can get an idea of what we are talking about.
Click our animated link below.  It's not really a good example because it's
more jerky than the Javascript code,  but we tried. ;)

Click this animation to view a sample page we made.

Here is the code.  Put it between the
<head> and </head> of your html page
or "fixed" html page. Whatever you wish.

Speed can be customized.
I highlighted in red "var speed=1"
If you want a zoomier scroll, then type in a larger number.

<SCRIPT language=JavaScript1.2>

//change 1 to another integer to alter the scroll speed. Greater is faster

var speed=1

var currentpos=0,alt=1,curpos1=0,curpos2=-1

function initialize(){

startit()

}

function scrollwindow(){

if (document.all &&

!document.getElementById)

temp=document.body.scrollTop

else

temp=window.pageYOffset

if (alt==0)

alt=2

else

alt=1

if (alt==0)

curpos1=temp

else

curpos2=temp

if (curpos1!=curpos2){

if (document.all)

currentpos=document.body.scrollTop+speed

else

currentpos=window.pageYOffset+speed

window.scroll(0,currentpos)

}

else{

currentpos=0

window.scroll(0,currentpos)

}

}

function startit(){

setInterval("scrollwindow()",50)

}

window.onload=initialize

</SCRIPT>

 

 

Return to our "Fixed Background Tips/Instructions Page."
Return to our "Watercolor Backgrounds Page."

 

Like this background? Get one for your site!

All graphics on this site (still and animated) have our embedded watermark. They are not public domain!

All contents (Graphics and Text)  are covered by U.S. Copyright Laws. No reproduction of any kind, downloading, copy, paste, save, etc. is allowed.    All rights reserved!

digimarc icon

surfing the net with kids trophy image
(Awarded 1/28/2009)

Thanks for Visiting. We love you! 

Brownielocks is  now on and

EMAIL ON HOME PAGE ONLY

PS: My web stats show we have now had over 41 MILLION unique visitors!  
Home | Contents | Backgrounds | Bizarre Holidays | Cartoons | Word Fun | Jokes | Traditional Holidays 
Brownielocks' Holidays & Fun For Everyone!  © 1999-2013