SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Click in TouchScreen

    Hi, i got a button with a click doing some function. The click is working fine on web browser but when i tested on my ios touch device its working but with delay. how to avoid the click delay in touch enable browsers so that i can touch button continuosly without any delay ....i know the events like mouseup,down equivalent to touchstart,down,etc.. i need for click...


    $("#button").click(function()
    {

    )};

  2. #2
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,002
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    AFAIK, click events don't work on iOS. You should use touchstart

  3. #3
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i tried with touchstart, touchend in place of click but none of it is working. any idea...

  4. #4
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,002
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    I'm away from the PC right now, but I'll have a look later on and get back to you.

  5. #5
    Gre aus'm Pott gold trophysilver trophybronze trophy
    Pullo's Avatar
    Join Date
    Jun 2007
    Location
    Germany
    Posts
    6,002
    Mentioned
    219 Post(s)
    Tagged
    12 Thread(s)
    This works as expected for me on my iPhone:

    Code:
    $("button").on("touchstart", function(){
      alert("hello");
    });
    you also had a typo in your code:

    Code:
    $("#button").click(function() 
    {
    
    )}; <---- bracket and curly brace are the wrong way round
    HTH


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •