Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8349587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T08:03:00+00:00 2026-06-09T08:03:00+00:00

I set a random order of slides in Supersized , but only the background

  • 0

I set a random order of slides in Supersized, but only the background images are random, the thumbs stay in the same order.

This is the part of the code (supersized.3.2.7.js) that random the image slides:

// Shuffle slide order if needed
if (base.options.random){
    arr = base.options.slides;
    for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);   // Fisher-Yates shuffle algorithm (jsfromhell.com/array/shuffle)
    base.options.slides = arr;
}

And that’s how I call the slide images and set the thumbs:

jQuery(function($){
    $.supersized({
        random: 1,
        thumb_links: 1,
        slides: [
                    { image: "slide_1.jpg", thumb: "thumb_1.jpg"},
                    { image: "slide_2.jpg", thumb: "thumb_2.jpg"},
                    { image: "slide_3.jpg", thumb: "thumb_3.jpg"},
                    { image: "slide_4.jpg", thumb: "thumb_4.jpg"},
                    { image: "slide_5.jpg", thumb: "thumb_5.jpg"},
                    { image: "slide_6.jpg", thumb: "thumb_6.jpg"}
                ]
    });
});

How can I make the thumbs on the same random order of the background images?

Update

I figure it out myself: instead of using the random option in Supersized, I define a array and sort it.

var slidesArray = [
    { image: "slide_1.jpg", thumb: "thumb_1.jpg"},
    { image: "slide_2.jpg", thumb: "thumb_2.jpg"},
    { image: "slide_3.jpg", thumb: "thumb_3.jpg"},
    { image: "slide_4.jpg", thumb: "thumb_4.jpg"},
    { image: "slide_5.jpg", thumb: "thumb_5.jpg"},
    { image: "slide_6.jpg", thumb: "thumb_6.jpg"}
]

And I call the plugin:

$.supersized({
    random: 0,
    thumb_links: 1,
    slides: slidesArray.sort(function() {return 0.5 - Math.random()})
});

Works great, but I’m not so sure if it’s the best way to do it. Any suggestions?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T08:03:01+00:00Added an answer on June 9, 2026 at 8:03 am

    I found a way, sort of…

    var slidesArray = [
        { image: "slide_1.jpg", thumb: "thumb_1.jpg"},
        { image: "slide_2.jpg", thumb: "thumb_2.jpg"},
        { image: "slide_3.jpg", thumb: "thumb_3.jpg"}
    ]
    

    And…

    $.supersized({
        random: 0,
        thumb_links: 1,
        slides: slidesArray.sort(function() {return 0.5 - Math.random()})
    });
    

    I’m new to javascript… Any ideas on how to make it better?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Java random always returns the same number when I set the seed?
I'm trying to generate a set of 100 random integers between a fixed range.
I need to be able to display a set of 1200 random combinations out
I've set up a basic script which loads a random quote into a web
Is it possible to print a random number in C++ from a set of
scala> Random.shuffle((1 to 10).toSet) res10: scala.collection.immutable.Set[Int] = Set(5, 10, 1, 6, 9, 2, 7,
set(TestProject_additional_libs optimized foobar.lib debug foobard.lib } especially what is optimized/debug mean here? Is this
I need to fetch a repeatable random set of rows from a table using
I have set up the JQuery Plugin Supersized (http://www.buildinternet.com/project/supersized/) and copied the set up
I would like display different pictures in a JFrame (in a random order). I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.