Advanced Search

Results 1 to 4 of 4

Thread: Possible to randomise scrolling content?

  1. #1
    Join Date
    Oct 2008
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Possible to randomise scrolling content?

    1) Script Title: Fading Scroller

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...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.
    Last edited by thegoose; 05-11-2009 at 06:17 PM.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,158
    Thanks
    28
    Thanked 623 Times in 619 Posts
    Blog Entries
    1

    Default

    Change:
    Code:
    var index = 0;
    To:
    Code:
    var index = Math.floor(Math.random()*index.length);
    In the beginning of the script

    And then about 20 lines below that, change:
    Code:
    index++
    To this:
    Code:
     index = Math.floor(Math.random()*fcontent.length);
    For more information: http://www.dynamicdrive.com/forums/blog.php?b=28
    Last edited by Nile; 05-11-2009 at 12:11 PM.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    thegoose (05-11-2009)

  4. #3
    Join Date
    Oct 2008
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Thank you so much. Works a charm and looks great.

  5. #4
    Join Date
    Jan 2008
    Posts
    4,158
    Thanks
    28
    Thanked 623 Times in 619 Posts
    Blog Entries
    1

    Default

    Glad to help you!
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •