Tagged: x
-
AuthorPosts
-
November 26, 2016 at 7:42 am #1271441November 26, 2016 at 3:36 pm #1271661
Hi there,
Thanks for writing in! You can try adding the following jQuery script in your Customizer via Appearance > Customize > Custom > Edit Global Javascript
(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);
Don’t forget to clear your browser’s cache after adding the code. Let us know how this goes!
November 26, 2016 at 8:04 pm #1271829No dice. Did not do it.
November 26, 2016 at 10:33 pm #1271883Hello There,
Thanks for updating in! You might be interested in these links:
https://davidwalsh.name/zoom-mobile-browsers
http://stackoverflow.com/questions/4472891/how-can-i-disable-zoom-on-a-mobile-web-page
http://stackoverflow.com/questions/13215730/how-to-disable-zooming-capabilities-in-responsive-designIf you follow what has been suggested in the links, since you have your child theme active and ready, please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file<?php // ============================================================================= // VIEWS/GLOBAL/_META.PHP // ----------------------------------------------------------------------------- // Outputs meta data into the <head> of the site. // ============================================================================= ?> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/> <!--320--> <title><?php wp_title( '' ); ?></title> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
3] Save the file named as
_meta.php
4] Upload this file to your server in the child theme’s folder
wp-content/themes/x-child/framework/views/global/
Hope this helps.
November 27, 2016 at 11:29 pm #1272748Thanks! It’s definitely disabling “tap-to-zoom” but i can still pinch and zoom in. No big deal, still works great, thanks!
November 27, 2016 at 11:37 pm #1272758Glad to hear that you’re welcome!
Or how about this?
<?php // ============================================================================= // VIEWS/GLOBAL/_META.PHP // ----------------------------------------------------------------------------- // Outputs meta data into the <head> of the site. // ============================================================================= ?> <meta charset="<?php bloginfo( 'charset' ); ?>"> <meta name="HandheldFriendly" content="true" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title><?php wp_title( '' ); ?></title> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
Thanks!
-
AuthorPosts