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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:29:03+00:00 2026-05-28T20:29:03+00:00

I have a page where I am cycling through a set of list elements

  • 0

I have a page where I am cycling through a set of list elements using jquery fadeout() & fadein().

Everything works fine, except I would now like to make it so:

  • the user can click a separate element that represents a li in the rotation.
  • When they click the element, the current animation cycle is stopped,
  • the corresponding content li is loaded
  • the animation resumes.

I believe I need to do this with jquery queues, but was wondering if there was an easier solution I’m overlooking.

Here is my code:

$(document).ready(function () {

var j = 0;
var fadetime = 700;
var delay = 3000; //millisecond delay between cycles
function cycleThru() {
    var jmax = $("ul#rotator li").length - 1;
    $("ul#rotator_pager li:eq(" + j + ")").css("background-color", "#660000");

    $("ul#rotator li:eq(" + j + ")").fadeIn(fadetime).delay(delay);

    $("ul#rotator li:eq(" + j + ")").fadeOut(fadetime, function () {
        $("ul#rotator_pager li:eq(" + j + ")").css("background-color", "");            
        (j == jmax) ? j = 0 : j++;            
        cycleThru();
    });

};

//Setup the clickers on the pager boxes. 
$("ul#rotator_pager li").click(function () {

    //Switch to this list element and resume animation cycle.

});


cycleThru();

});

Corresponding HTML —

<ul id="rotator">
<li id="first">
    <div><!--HTML Goes HERE--></div>
</li>
<li>
    <div><!--HTML Goes HERE--></div>
</li>
<li>
    <div><!--HTML Goes HERE--></div>
</li>
</ul>
<ul id="rotator_pager">
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
    <li><a href="#"></a></li>
</ul>
  • 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-28T20:29:05+00:00Added an answer on May 28, 2026 at 8:29 pm

    So, I stepped away from it for a few mins and figured it out. You do need to use the Jquery queue’s but it was not nearly as complicated as I thought. Here’s the solution for others:

    $(document).ready(function () {
    
    var j = 0;
    var fadetime = 700;
    var delay = 3000; //millisecond delay between cycles
    function cycleThru() {
        var jmax = $("ul#rotator li").length - 1;
        $("ul#rotator_pager li:eq(" + j + ")").css("background-color", "#660000");
    
        $("ul#rotator li:eq(" + j + ")")
            .fadeIn(fadetime)
            .delay(delay)
            .fadeOut(fadetime, function () {
                $("ul#rotator_pager li:eq(" + j + ")").css("background-color", "");
                (j == jmax) ? j = 0 : j++;
                cycleThru();
            });
    
    };
    
    //Setup the clickers on the pager boxes. 
    var items = $("ul#rotator_pager li").click(function () {
        $("ul#rotator li:eq(" + j + ")").clearQueue();
        $("ul#rotator li:eq(" + j + ")").stop();
        $("ul#rotator li:eq(" + j + ")").hide();
        $("ul#rotator_pager li:eq(" + j + ")").css("background-color", "");
        j = items.index(this);
        cycleThru();
        //Switch to this list element and resume animation cycle.
    
    });
    
    
    cycleThru();
    

    });

    Basically, when you click on the list element, it :

    • clears all of the animations (dequeue and .stop),
    • hides the currently showing content list element,
    • sets the selector of the content list element to the cooresponding selected list element
    • finally, kicks off the animation again.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ok so I have two instances on a page where I am using Jquery
I'm using the jQuery Cycle plugin (malsup.com/jquery/cycle/) on this page: http://artandculturecenter.org It works as
I have page, that loads in data using AJAX (a form filter) using jQuery.
I have page (Default1.aspx) in which I am redirecting to another page (Default2.aspx) using
Ok, I have page one(index), fully functional and working fine as is with all
Is there a way to select all elements that have a given style using
I have Page A which calls Page B using AJAX. Page B will be
I want to cycle through each page of a paginated model's index. I'm using
I have page there is button which shows iframe where is small list with
I have page that creates a table: http://gupii.co.uk/rap/weekTable.php and I'm using a plugin to

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.