Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fast Buttons for Mobile Web Applications

I build a WepApp and I like to remove the 300ms delay on touch-devices with this code from Google

DOC
http://developers.google.com/mobile/articles/fast_buttons

I not sure, I don't see any difference between both version on my HTC one X.

Demo 1 (normal)
http://jsbin.com/awejal/4/edit

Demo 2 (with fastclick fix)
http://jsbin.com/awejal/5/edit

I get (in Demo 2) additional an error in the console TypeError: element is null but why? I don't get it.

like image 347
user1815934 Avatar asked Nov 04 '22 11:11

user1815934


1 Answers

The issue is almost certainly from your typerror. A TypeError like that means you tried to call a method on a null object. You need to find out why you are getting that typerror, and then fix it. Without the proper linking between the DOM and the jQuery the google supplied code won't help.

I think the line that is causing you problems is the

new FastButton(document.getElementById("fastclick"), goSomewhere);

because I didn't see any element with id fastclick.

Try fixing that and let me know how it works

like image 174
OneChillDude Avatar answered Nov 15 '22 07:11

OneChillDude