See source: http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.js
Find the tap event (starts at line 1049):
$.event.special.tap = {
In line 1090 - 1092:
timer = setTimeout(function() { triggerCustomEvent( thisObject, "taphold", $.Event( "taphold" ) ); }, 750 );
Change the delay of the taphold event.
750ms = 0.75s
1000 is .....
1000 is equal to 1 second
To comment
Override the special click event with the new timer settings: bound from 750 to 1000
This code can be placed after enabling script af jQuery mobile ( <script src='jquery.mobile.js'></script> and then <script>$.event.special.tap = {...}</script> )
$.event.special.tap = { setup: function() { var thisObject = this, $this = $( thisObject ); $this.bind( "vmousedown", function( event ) { if ( event.which && event.which !== 1 ) { return false; } var origTarget = event.target, origEvent = event.originalEvent, timer; function clearTapTimer() { clearTimeout( timer ); } function clearTapHandlers() { clearTapTimer(); $this.unbind( "vclick", clickHandler ) .unbind( "vmouseup", clearTapTimer ) .unbind( "vmousecancel", clearTapHandlers ); } function clickHandler(event) { clearTapHandlers();
source share