Sunday 15 May 2011

mobile - jQuery .hide() causing a ghost touchstart "click" of 2nd button -



mobile - jQuery .hide() causing a ghost touchstart "click" of 2nd button -

i have 2 buttons on page, need hide "calculate" button not clicked 1 time again , again, rather users select "reset" button.

this works great if both buttons showing if hide calculate button, 1 time has completed work, somehow automatically executing reset button though reset button not beingness clicked.

this happens on touch devices. works fine if run browser. touch devices (ex. iphone) issue occurring. clues? using jquery-2.1.1.min

here calculate button:

$(document).on( 'touchstart click' , '#calculate' , function () { // stuff //hide button done users don't maintain clicking $( '#calculate' ).hide(); });

here reset button:

$(document).on( 'touchstart click' , '#reset' , function () { $( "input.form-control" ).val(0); });

here working example:

http://investingcalculator.azurewebsites.net/

did seek without delegating?

$('#calculate').on( 'touchstart click', function () { // stuff //hide button done users don't maintain clicking $( '#calculate' ).hide(); }); $('#reset').on( 'touchstart click', function () { $( "input.form-control" ).val(0); });

jquery mobile

No comments:

Post a Comment