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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:03:17+00:00 2026-05-25T12:03:17+00:00

I have a working adding/removing numbers that I just created for showing the number

  • 0

I have a working adding/removing numbers that I just created for showing the number of current page attached to the content slider which is not a feature of the slider ( please take a look http://sneakyrascal.com/coupon2 )

slider changes each content per second when the arrow is clicked but the number will be changed immediately so when the user clicks on it 5 times quickly the content won’t reach the number for example the page may be in the third page but the number is 5!

I’ve tried to use .delay it it didn’t work… is there a way to add to the script so the click won’t be immediate effect on the current number? For example more than one click on the arrow will effect only once per second, that should do the trick I think…

$(function(){
  $(".jcarousel-next-horizontal").click(function(){
    var currentValue = $(".pages").text();
    var five = "5";
    var newValue = parseInt(parseFloat(currentValue)) + 1;
    $(".pages").text(newValue);
    if (currentValue==five) {
      $(".pages").text("5");
    }
  });

  $(".jcarousel-prev-horizontal").click(function(){
    var currentValue = $(".pages").text();
    var newValue = parseInt(parseFloat(currentValue)) - 1;
    var one = "1";
    $(".pages").text(newValue);
    if (currentValue==one) {
      $(".pages").text("1");
    }
  });
});
  • 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-25T12:03:18+00:00Added an answer on May 25, 2026 at 12:03 pm

    The easiest way is probably to store the time of the last click and when a new click occurs, compare the current time to the time of the previous click and ignore the click if less than one second has passed since the previous click.

    The time can be stored either in a global variable or (probably better) associated with the actual object using jQuery’s data() methods.

    For example:

      $(".jcarousel-prev-horizontal").click(function(){
        var currentTime = Date.now();
        var lastClickTime = $(this).data("lastClickTime");
        if (lastClickTime && (currentTime - lastClickTime < 1000)) {
             return(false);   // ignore the click
        }
        $(this).data("lastClickTime", currentTime);   // record time of last click
        var currentValue = $(".pages").text();
        var newValue = parseInt(parseFloat(currentValue)) - 1;
        var one = "1";
        $(".pages").text(newValue);
        if (currentValue==one) {
          $(".pages").text("1");
        }
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this select that is constantly changing (adding, removing, etc)... It goes something
I'm working on adding globalization to my product cataloge and I have made it
I'm adding repeating events to a Cocoa app I'm working on. I have repeat
I am working on a server-side framework. Here and there I have been adding
I have been working with a string[] array in C# that gets returned from
I have been working on some legacy C++ code that uses variable length structures
I'm adding and removing a JButton on MouseEnter and MouseExit respectively. This is working
I'm working in Java, and I have a JPanel in a JFrame. In that
Is there a way of storing and working (adding ,removing etc..) with tree data
Hi I have just started working with Highstock's javascript charts and was trying 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.