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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:02:15+00:00 2026-05-19T10:02:15+00:00

In a page, I have 4 divs to be made slideshow. Let’s call them

  • 0

In a page, I have 4 divs to be made slideshow. Let’s call them divA-divD. Every div has 2 sets of images.

So I use jQuery cycle to turn those divs into slideshows. The catch is, I want to have a sequential slideshow. I’m not sure i can explain it clearly, but it goes like this.

Timeout = 4000 (4 seconds)
divA = 1000 + Timeout (1 second)
divB = 1333 + Timeout
divC = 1666 + Timeout
divD = 2000 + Timeout (2 seconds)

Now my current code for that is

var timeout = 4000;
$('.divA').cycle({
    fx:     'fade',
    speed:  2000,
    timeoutFn: 1000+timeout
});
$('.divB').cycle({
    fx:     'fade',
    speed:  2000,
    timeoutFn: 1333+timeout
});

so on with divC and divD

but the result will be like this

divA = 1000 + 4000 = 5000
divB = 1333 + 4000 = 5333
divC = 1666 + 4000 = 5666
divD = 2000 + 4000 = 6000

That will make the divD will eventually catch up with divA if left too long because :

divA = 5,10,15,20,25,30
divD = 6,12,18,24,30

divD’s fifth slide will be simultaneous with divA sixth slide.

I want the cycle to somehow pause after the divD’s cycle. So it goes like this :

1-4th second : show images
4-5th second : fade divA – divD then pause for 4 more seconds
5-8th second : still pause
9-10th second : another cycle, then pause for 4 more seconds
10-13th second : pause
and so on.

i’ve made the formula but found the difficulty in implementing it

timeout* (index) + (1000* (index-1));

divA = timeout * (index) + (1000 * (index-1))
divB = timeout * (index) + (1000 * (index-1) + 333)
divC = timeout * (index) + (1000 * (index-1) + 666)
divD = timeout * (index) + (1000 * (index-1) + 1000)

where index = the loop of the slides (1,2,3,4,5,…..)

that will make

divA = 4000 * 1 + 1000 * (0) = 4000, 4000 * 2 + 1000 * (1) = 9000, etc
divB = 4000 * 1 + 1000 * (0) + 333 = 4333, 4000 * 2 + 1000 * (1) + 333 = 9333, etc
divC = 4000 * 1 + 1000 * (0) + 666 = 4666, 4000 * 2 + 1000 * (1) + 666 = 9666, etc
divD = 4000 * 1 + 1000 * (0) + 1000 = 5000, 4000 * 2 + 1000 * (1) + 1000 = 10000, etc

the question is, how can i do it in jquery cycle? I’ve tried using timeoutFn and having a callback function like this:

function calculateTimeout(currElement, nextElement, opts, isForward) { 
    var index = opts.currSlide; 

    return timeout * (index) + (1000* (index-1)); 
}

but the index stays 0->1->0->1-> etc. (because I only have two images per div)

I’m sorry if it’s too long or I’m not being clear enough, and thanks in advance for your answers

  • 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-19T10:02:16+00:00Added an answer on May 19, 2026 at 10:02 am

    i found the solution!

    http://jsfiddle.net/uygey/4/

    or if you feel like reading, read below. it’s somewhat a hack / cheat, but whatever works, i guess 🙂

    var index = -1;
    
    $('.divA,.divB,.divC,.divD').cycle({
    fx:     'fade',
    speed:  2000,
    timeoutFn: calculateTimeout
    });
    
    function calculateTimeout(currElement, nextElement, opts, isForward) { 
    var class = $(currElement).parent().attr('class');
    var timeout = 4000;
    var wait;
    if(class=="divA"){
    wait = 0;
    }else if(class=="divB"){
    wait = 333;    
    }else if(class=="divC"){
    wait = 666;
    }else if(class=="divD"){
    wait = 1000;
    }
    
    if(class=="divA"){
    index++; 
    }    
    
    return timeout * (index) + ((1000* (index-1)) + wait); 
    
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have divs on my page as below: <div id="switch"> <div id="b1"></div> <div id="b2"></div>
We have an HTML page which displays a bunch of pretty bars using divs
If you have several div s on a page, you can use CSS to
I have a web page with DIV s with a mouseover handler that is
I have a page where there is a column and a content div, somewhat
i have multiple divs with the same class on my page. I want to
I have an ASPX page and on this page I have a control that
On my page I have a drop-down select box, with a default value of
In a particular page i have a ascx control which contains a table. Now
Here's the problem: 1.) We have page here... www.blah.com/mypage.html 2.) That page requests a

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.