Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to prevent fastclick from firing “active” state on scroll?

I’m using FastClick on a page with large links because I want to bypass the 300ms delay for taps in mobile browsers. I have a “highlight” style for the links’ :active states and it is properly firing quickly, thanks to FastClick.

My problem is that – in Mobile Safari at least – it also fires while you’re tapping and swiping to scroll the page. This makes it feel like you can’t scroll the page without it thinking you’re trying to tap the links.

Is there a way to prevent it from firing when someone scrolls?

like image 425
Joel Farris Avatar asked Jan 20 '16 21:01

Joel Farris


1 Answers

Maybe you can add the needsclick class to the body?

<body class="needsclick">

...

</body>

Just an idea :)

like image 97
alsdkjasdlkja Avatar answered Oct 30 '22 09:10

alsdkjasdlkja