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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:38:27+00:00 2026-05-27T13:38:27+00:00

I am using jquery animate for the slide. I have an arrow at the

  • 0

I am using jquery animate for the slide. I have an arrow at the end of the slide and given the click event on that arrow. The working of it is to move one item inside the silde on click and move the entire silde on mousedown. This is working fine in desktop but in iPad two items are coming inside the slide at a time on click. I am not understanding why the click event is called twice in iPad. The sample code for the click is :

    $('#next_item').bind('mousedown touchstart MozTouchDown',function(e) {                    
        $('.slide').animate({left:left},6000);   
    });

    $('#next_item').bind('mouseup touchend MozTouchRelease',function(e) {   
        No.nextItem();          
    });

#next_item is the id of the arrow at the end of the slide. I have tried to unbind touchstart and touchend event but during slide scroll due to unbind the item does not come inside the slide after single item. No.nextItem() moves one item inside the slide. left in $('.slide') is to move the slide left. Please help me find the solution why this is happening and how to solve this issue for ipad.

  • 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-27T13:38:28+00:00Added an answer on May 27, 2026 at 1:38 pm

    iPad both understands touchstart/-end and mousestart/-end.

    Is gets fired like this:

    ┌─────────────────────┬──────────────────────┬─────────────────────────┐
    │Finger enters tablet │ Finger leaves tablet │ Small delay after leave │
    ├─────────────────────┼──────────────────────┼─────────────────────────┤
    │touchstart           │ touchend             │ mousedown               │
    │                     │                      │ mouseup                 │
    └─────────────────────┴──────────────────────┴─────────────────────────┘
    

    You have to detect if the user is on a tablet and then relay on the touch start things…:

    /********************************************************************************
    * 
    * Dont sniff UA for device. Use feature checks instead: ('touchstart' in document) 
    *   The problem with this is that computers, with touch screen, will only trigger 
    *   the touch-event, when the screen is clicked. Not when the mouse is clicked.
    * 
    ********************************************************************************/
    var isIOS = ((/iphone|ipad/gi).test(navigator.appVersion));
    var myDown = isIOS ? "touchstart" : "mousedown";
    var myUp = isIOS ? "touchend" : "mouseup";
    

    and then bind it like this:

    $('#next_item').bind(myDown, function(e) { 
    

    You can also make a event that takes care of it, see:

    http://benalman.com/news/2010/03/jquery-special-events/

    Basic normalized down event:

    $.event.special.myDown = {
        setup: function() {
            var isIOS = ((/iphone|ipad/gi).test(navigator.appVersion));
            var myDown = isIOS ? "touchstart" : "mousedown";
            $(this).bind(myDown + ".myDownEvent", function(event) {
                event.type = "myDown";
                $.event.handle.call(this, event);
            });
        },
        teardown: function() {
            $(this).unbind(".myDownEvent");
        }
    };
    

    After jQuery 1.9.0 $.event.handle changed name to $.event.dispatch, to support both you can write use this fallback:

    // http://stackoverflow.com/questions/15653917/jquery-1-9-1-event-handle-apply-alternative
    // ($.event.dispatch||$.event.handle).call(this, event);
    $.event.special.myDown = {
        setup: function() {
            var isIOS = ((/iphone|ipad/gi).test(navigator.appVersion));
            var myDown = isIOS ? "touchstart" : "mousedown";
            $(this).bind(myDown + ".myDownEvent", function(event) {
                event.type = "myDown";
                ($.event.dispatch||$.event.handle).call(this, event);
            });
        },
        teardown: function() {
            $(this).unbind(".myDownEvent");
        }
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to animate something using jQuery. UPDATE I have it working the way
I have a few panels that I slide horizontally using the animate function that
I have 4 icons that, on mouse over, scroll a div using jQuery animate.
I'm using this jQuery to hide a DIV: $(#slider).click(function() { $(.help).slideToggle(); $(#wrapper).animate({ opacity: 1.0
I want to use .animate to change colors when .bind('click') is fired, using jquery
Using jQuery, how do you bind a click event to a table cell (below,
I am using the jQuery UISlider. I have it set up so that upon
I'm making a horizontal scroller using jQuery. I have it working using the following
I have a page that has multiple sliders (from http://www.switchonthecode.com/tutorials/using-jquery-slider-to-scroll-a-div ) and since each
I have a very basic function which I am using jQuery to slide some

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.