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 7412941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:37:09+00:00 2026-05-29T06:37:09+00:00

Is there a good way of using jQuery cycle to randomise slides based on

  • 0

Is there a good way of using jQuery cycle to randomise slides based on a weighting? Using the following markup (I am open to other suggestions):

<div id="carousel">
    <div title="Slide no. 1" data-weight="50"><h2>1</h2></div>
    <div title="Slide no. 2" data-weight="25" class="first"><h2>2</h2></div>
    <div title="Slide no. 3" data-weight="25"><h2>3</h2></div>
</div>

I would like to show slide 1 50% of the time and slides 2 & 3 25% of the time. Is there a decent way of queueing up the next slide maybe using the ‘before’ option?

Many thanks.

  • 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-05-29T06:37:10+00:00Added an answer on May 29, 2026 at 6:37 am

    Given your very limited case (of only 1 slide requiring a longer duration) you could use use the delay timeout for your first slide (say 2000) and the timeout parameter for slides 2 & 3 (at say 1000) giving the desired effect.

    The cycle plugin prameters are described as :

    delay:   0,     // additional delay (in ms) for first transition (hint: can be negative) 
    timeout: 4000,  // milliseconds between slide transitions (0 to disable auto advance) 
    

    While I haven’t tried this, if you need something more advanced I suspect you could create a callback for the timeout parameter. The callback would inspect the data-weight param and use it as a weighting factor. I suspect it would work out of the box, or would only require minor modifications to the jQuery cycle plugin.

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

Sidebar

Related Questions

Is there a good way to time SQL queries when using Linq to SQL?
If you are using Java or JavaScript, is there a good way to do
When using linq and you have c.Sort() Is there any good inline way of
Does anyone have some good suggestions when it comes to authenticating clients using JQuery
I'm using jQuery Mobile and its mostly good. Although there are a few errors.
Is there any good way to deal with the class renaming refactor from Resharper
Is there a good way for displaying unicode text in opengl under Windows? For
Is there a good way to create a form in VB6 that can easily
Is there a good way to see what format an image is, without having
Is there a good way to find out which exceptions a procedure/function can raise

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.