Jump to content

How to change random generted pictures into slideshow.


Recommended Posts

HelloFirst of all, sorry for my terrible english, but I always had problems with grammar ^^' I have some problem with this page:http://www.histologia.cm-uj.krakow.pl/Repetytorium/rep_test.html This is something like random flashcard with pictures. It's very good for cheking knowledge, but first you have to learn this. And there occures my problem. How to change this java script algorytm that generate random picture, to generate this picture from the list in turn? I have no idea how to edit js but i think this line is responsible for random pictures generate:

i = Math.round( i * Math.random() );

I'm waiting for a response

Link to comment
Share on other sites

are you asking how to change the incrementation to be sequential instead of random? Also, why don't you just create the array's with value's already inside them?i.e.var link = ['imagepath1.jpg', 'imagepath2.jpg', 'etc', 'etc']; The simple solution would something like this.

i += 1;

But you are going to need to have actual next and previous functions to increment/decrement the index (since . You should be able to find plenty of javascript slideshow examples online that will give you a basic idea of how to do this. Also, I would advise against using document.write

Link to comment
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

  • Create New...