Jump to content
xisto Community
Sign in to follow this  
Mario

Image Scroller?

Recommended Posts

does anybody know where i can find a image scroller script? scrolling up and down?

it's a great idea and i'd like to know how to work like other javascript .you must know the spring menu javascript . :(

Share this post


Link to post
Share on other sites
[br]<script language="JavaScript">[/br]<!----[br]var x = 5 [/br]var y = 5 [br]var change = 10 [/br]var img, img_top,img_left[br][/br]function move(){[br]if(document.layers)[/br]{[br]img = eval("document.image")[/br]img.top = img.top + x[br]img.left = img.left + y[/br]if(img_top >= window.innerHeight) x = -x[br]if(img_left >= window.innerWidth) y= -y[/br]if(img_top <= 0) x = 5[br]if(img_left <= 0) y = 5[/br]}[br][/br]else [br]{[/br]img = eval("image.style")[br]img.posTop = img.posTop + x[/br]img.posLeft = img.posLeft + y[br]img_top = img.posTop[/br]img_left = img.posLeft[br]if(img_top >= document.body.clientHeight) x = -x[/br]if(img_left >= document.body.clientWidth) y= -y[br]if(img_top <= 0) x = 5[br]if(img_left <= 0) y = 5[/br]}[br][/br]SetTimeout("move()", change) }[/br]//---->[br]</SCRIPT>[/br]

method:
1.put the code between <body> and </body>
2.change these to yours
var x = 5 //horizontal distance
var y = 5 //vertical distance
var change = 10 //time to change,more big more slower

3.use these codes to refers to your javescript between <body> and </body>
<DIV id="image" style="position: absolute;">
<img src="move.gif" alt="moving gif">
</DIV>

4.rewrite your <body> like this:
<BODY onload="setTimeout('move()', 10)">

then,enjoy!

Share this post


Link to post
Share on other sites

never heard of such a thing. u can change the color of the scroll bar but im not sure you can make it into an image. u have made windows that have something like that but note sure thats what u want. ill try to find the link and post it if the other code someoneelse put doesn't work for you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.