jquery - Button press using modal dialog on Ipad -
in app have button when clicked opens bootstrap modal dialog.
now know ipad doesn't click events, used following code found on tutorial:
var ua = navigator.useragent, event = (ua.match(/ipad/i)) ? "touchstart" : "click"; $("button#loginsignup").bind(event, function(e) { $('#dialogs').load('dialogs/login-signup.php', function(){ $('#dialog').modal() }); })
but problem is, when press button:
<button id="loginsignup" class="btn btn-primary full-width">login or signup</button>
the dialog slides in top , instantly goes again if close button pressed.
how fix error?
some info. have noticed if button positioned dialog lands i.e dialog ends coving button, dialog stays.
i did with:
$("button#loginsignup").bind(event, function(e) { e.preventdefault() $('#dialogs').load('dialogs/login-signup.php', function(){ $('#dialog').modal() }); })
Comments
Post a Comment