This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Javascript event off on iPad
#1
Do somebody knows how to limit events generating on "vclick"? I've prepared the .lp file which generates a table with hvac controllers values. I want prepare some functions which are based on "vclick" but I must have a solution for generating only 1 click on real 1 click but default javacript reaction is that for 1 real click there are 17 "vclick" events.

I've tried something like this:
Code:
    $('.table > tbody > tr > td:nth-child(3)').on('vclick', function(){
    console.log(this.innerText)
    $( this ).off( event.type );
    });

and its working on every webbrowsers only not on Safari(PC, iPad).

Maybe somebody can give some advice what can be improved in above script?
Reply
#2
You're missing event argument in function, it should be .on('vclick', function(event){. You can also replace "on" with "one", so you don't even need to call "off".
Reply
#3
(16.05.2017, 10:40)admin Wrote: You're missing event argument in function, it should be .on('vclick', function(event){. You can also replace "on" with "one", so you don't even need to call "off".

The problem was the function which was in the for loop because of the "}" in the wrong place. But thanks for helpWink Now I know about .one() function alsoWink
Reply
#4
I had still a little trick with iPad but when I've changed "vclick" to "click" all starts working as I want.
Reply


Forum Jump: