javascript - iPhone HTML disable double tap to zoom -
i designing website focused on data entry. in 1 of forms have buttons increment , decrements number value in form field quickly. using
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
to disable zoom appeared work using firefox app ios. however, when user tested safari, clicking on button fast resulted in zooming in on page, distracting user , making impossible increase value quickly. appears of ios 10, apple removed user-scalable=no accessibility reasons, that's why works in 3rd party browsers firefox. closest found disabling double tap zoom this
var lasttouchend = 0; document.addeventlistener('touchend', function (event) { var = (new date()).gettime(); if (now - lasttouchend <= 300) { event.preventdefault(); } lasttouchend = now; }, false);
from https://stackoverflow.com/a/38573198 however, disables tapping altogether, although prevents double tap zooming, prevents user entering values quickly. there way allow button pressed quickly, while disabling double tap zoom?
add header. works me.
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
Comments
Post a Comment