PDA

View Full Version : Resolved Possible to randomise scrolling content?



thegoose
05-11-2009, 10:56 AM
1) Script Title: Fading Scroller

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex2/fadescroll.htm

3) Describe problem: Does anyone know how to randomise the content in this script? I'm using it to display quotes, but ideally would like the first quote displayed not always to be the same one. Will post on paid for thread if there's a lot of work involved.

Nile
05-11-2009, 12:01 PM
Change:


var index = 0;

To:


var index = Math.floor(Math.random()*index.length);

In the beginning of the script

And then about 20 lines below that, change:


index++

To this:


index = Math.floor(Math.random()*fcontent.length);


For more information: http://www.dynamicdrive.com/forums/blog.php?b=28

thegoose
05-11-2009, 06:12 PM
Thank you so much. Works a charm and looks great. :)

Nile
05-11-2009, 09:41 PM
Glad to help you!