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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:41:03+00:00 2026-06-07T07:41:03+00:00

I have a recursive loop that does a simple animation. These animations are controlled

  • 0

I have a recursive loop that does a simple animation. These animations are controlled by on page load & onclick of controls .carousel_item.

LIVE SAMPLE JSFIDDLES CLICK HERE stripped down for simplicity purposes

Problem: When Repeat clicking on the same control the animation will fire over and over. I would like the animation to only fire once per carousel_item.

UPDATEI would like the animation to only fire once per carousel_item. And reset when the following carousel_item is clicked.

EXAMPLE: Pushing 1 repeatedly will trigger the animation over and over again. I would like the first press to trigger the animation once. Next User mashes 2 this will retrigger the animation once and not repeatedly. User can still push 1 again for the mashing is all I want to prevent

Logically, I see the click unbinding itself and rebinding itself on click of another .carousel_item that’s my logic; however, I’m sure there’s a better solution

var carItems = $('.carousel_item');
var sideitems = $('.side_item');
var x = false;
$(sideitems).hide();
fadeItem();

$(carItems).on({
    click: function () {

        $(sideitems).stop(true, true).animate({
            right: '4.5em'
        });
        $(sideitems).hide();

        fadeItem();

    },
    mouseenter: function () {

    },
    mouseleave: function () {

    }
});


function fadeItem() {
    $('.side_ul li:hidden:first').fadeIn(fadeItem).animate({
        right: '-4.5em'
    }, 150, function () {});;
}​

HTML

<div id="carousel" class="flexslider">
      <ul class="slides">
        <li class="carousel_item"> <img src="asset/img/1600/slide1_1600.jpg" /> </li>
        <li class="carousel_item"> <img src="asset/img/1600/slide2_1600.jpg" /> </li>
        <li class="carousel_item"> <img src="asset/img/1600/slide1_1600.jpg" /> </li>
        <li class="carousel_item"> <img src="asset/img/1600/slide2_1600.jpg" /> </li>
        <!-- items mirrored twice, total of 12 -->
      </ul>
    </div>

      <nav class="side_nav">
    <ul class="side_ul">
        <li class="side_item home"><div class="text_links"><a href="#">home</a></div></li>
        <li class="side_item document"><div class="text_links"><a href="#">docs</a></div></li>
        <li class="side_item video"><div class="text_links"><a href="#">video</a></div></li>        
        <li class="side_item programming"><div class="text_links"><a href="#">web</a></div></li>

    </ul>
  </nav>

enter image description here
LIVE SAMPLE JSFIDDLES CLICK HERE

  • 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-06-07T07:41:05+00:00Added an answer on June 7, 2026 at 7:41 am

    Working Demo http://jsfiddle.net/ScbDG/2/

    You can use .off after click event; http://api.jquery.com/off/ & $(this) will make sure that its set to off for that particular object.

    Good read: Best way to remove an event handler in jQuery?

    Hope this helps, :)

    code

    $(carItems).on({
         click: function () {
    
             $(sideitems).stop(true, true).animate({
                 right: '4.5em'
             });
             $(sideitems).hide();
    
             fadeItem();
             $(this).off('click');
    
         },
         mouseenter: function () {
    
         },
         mouseleave: function () {
    
         }
    
    
    
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a routine which uses a recursive loop to insert items into a
I have a linq to objects query in a recursive loop and afraid when
I have a recursive function working on a list, the function contains a loop
I have a recursive method on the base form that takes in a control
If I have a loop that enqueues say 100 tasks and each one of
I have this function that I wrote that is abysmally slow since php does
I have a multi-thread C# application that uses some recursive functions in a dll.
I have an app that does an iteration to create points on a graph
If I have a self-referential Topic class and I want to recursively loop through
I have an interesting problem. I wrote the following perl script to recursively loop

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.