IOS HTML disable double tap to zoom
The CSS property touch-action
works for me. Tested on iOS 11.1.
button {
touch-action: manipulation;
}
See MDN for more info: https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action
Disable double-tap zoom option in browser on touch devices
I just wanted to answer my question properly as some people do not read the comments below an answer. So here it is:
(function($) {
$.fn.nodoubletapzoom = function() {
$(this).bind('touchstart', function preventZoom(e) {
var t2 = e.timeStamp
, t1 = $(this).data('lastTouch') || t2
, dt = t2 - t1
, fingers = e.originalEvent.touches.length;
$(this).data('lastTouch', t2);
if (!dt || dt > 500 || fingers > 1) return; // not double-tap
e.preventDefault(); // double tap - prevent the zoom
// also synthesize click events we just swallowed up
$(this).trigger('click').trigger('click');
});
};
})(jQuery);
I did not write this, i just modified it. I found the iOS-only version here: https://gist.github.com/2047491 (thanks Kablam)
How do you disable viewport zooming on Mobile Safari?
Edit: may not work after iOS 10, please see touch-action
based solution below.
Your code is displaying attribute double quotes as fancy double quotes. If the fancy quotes are present in your actual source code I would guess that is the problem.
This works for me on Mobile Safari in iOS 4.2.
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
Related Topics
Prevent Requestanimationframe from Running All the Time
Detecting Screen Resolution to Load Alternative CSS a Good Idea
Iframe Dynamic Height Width Change Based on Inner Content
Hover Effects on Irregular Polygons in CSS
How to Build SASS/Less/CSS in Webpack Without Requiring Them in My Js
Inset-Shadow on HTML5 Canvas Image
Jquery .Position() Strangeness While Using CSS3 Rotate Attribute
Changing Leaflet Markercluster Icon Color, Inheriting the Rest of the Default CSS Properties
Animating Max-Height with Pure Js
Jquery .Css() Function with Variables and Multiple Values
How to Change CSS Href="" Using JavaScript
Modify Pseudo Select :After in JavaScript
How to Activate a CSS3 (Webkit) Animation Using JavaScript
How to Disable Smooth Scrolling in Ie11
How Much of an Effect Can Different Operating Systems Have on Displaying Web Pages
How to Apply D3.Js Svg Clipping After Zooming
Detect When Scrolling Has Finished When Using 'Scroll-Behavior: Smooth'