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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:26:59+00:00 2026-05-15T22:26:59+00:00

I got this jquery code. And this is some kind of slideshow with fading

  • 0

I got this jquery code. And this is some kind of slideshow with fading effect. So it loops… this is the first code

$(document).ready(function(){
    function looptour(){
        $("#health").hide();
        $("#billing").hide();
        $("#pension").delay(6000).fadeOut(2000);
        $("#health").delay(6000).fadeIn(2000).delay(6000).fadeOut(2000);
        $("#billing").delay(14000).fadeIn(2000).delay(6000).fadeOut(2000);
        $("#pension").delay(14000).fadeIn(2000,looptour);
    }
    looptour();
});

My problem is to how to stop the loop that you saw on the first code onclick event? Then after clicking that event a new loop will proceed and so on…

Here’s the new code,

$("#tournums").click(function(){
    function billingloop(){
        $("#health").hide();
        $("#pension").hide();
        $("#billing").delay(6000).fadeOut(2000);
        $("#pension").delay(6000).fadeIn(2000).delay(6000).fadeOut(2000);
        $("#health").delay(14000).fadeIn(2000).delay(6000).fadeOut(2000);
        $("#billing").delay(14000).fadeIn(2000,looptour);
    }
    billingloop();
});

Thank you so much jquery masters for helping me out with this problem of mine.

  • 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-15T22:26:59+00:00Added an answer on May 15, 2026 at 10:26 pm

    My best guess is to use .clearQueue() for this:

    function stopLoop() {
        $("#pension").clearQueue();
        $("#health").clearQueue();
        $("#billing").clearQueue();
    }
    
    // snip //
    
    $("#tournums").click(function(){
        stopLoop();
    
        function billingloop(){
            $("#health").hide();
            $("#pension").hide();
            $("#billing").delay(6000).fadeOut(2000);
            $("#pension").delay(6000).fadeIn(2000).delay(6000).fadeOut(2000);
            $("#health").delay(14000).fadeIn(2000).delay(6000).fadeOut(2000);
            $("#billing").delay(14000).fadeIn(2000,looptour);
        }
        billingloop();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jquery code: $(.button-banc).hover(function() { $(.button-banc img) .animate({ top: -21px }, 200).animate({
My project uses jQuery 1.4.2. I've got some security information that I add to
Got kind of a tricky problem. I'm working on a project where we need
I have this html: <div class=portlet-header> Company Information ... <button> some button here </button>
I am very new to ajax and jquery but I know some php. I
I got the code from here the Code is not working, I have the
I refer to this question: Javascript value to PHP with Jquery I tried with
This question has been asked before, see: jQuery select only tr/td in main table,
Possible Duplicate: How to enable or disable an anchor using jQuery? I've got an
I'm using the jquery tabs plugin and want to have the background a light

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.