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 got this code: function init(){ if (typeof window.jQuery !== 'function') { var
I've got this piece of code in my jquery validation script: resetForm: function() {
I'm using jquery-ui autocomplete to validate some form inputs. I've got this code :
I got this code today that works for jQuery v7. The problem is that
i got a jquery code from this link (end of page): How to scroll
I'm upgrading an app from prototype.js to jquery. I've got this code (prototype.js): var
I've got this jQuery function: function phpmail(){ $.post('mail.php',{name:$(#name).val()}, function(out){ alert(out); }); } and this
I've got this bit of JQUERY: <script> function initNav() { $('.nav tr table td
I have this jquery code: $(.button-banc).hover(function() { $(.button-banc img) .animate({ top: -21px }, 200).animate({
I've got this code: <html> <head> <link type=text/css href=css/blitzer/jquery-ui-1.7.2.custom.css rel=stylesheet /> <script type=text/javascript src=js/jquery-1.3.2.min.js></script>

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.