Disable Zoom and Expand on touchscreen devices.
Posted: Tue Jan 07, 2014 4:41 pm
You can disable the Zoom and Expand features on touch type devices so that the add-on just swaps the main product image.
To do this, go to Design / Library / Layouts / Zoom Image Layout / Magic Zoom Support and look for the line:
Immediately after this add:
You could further tweak this to only operate on screens below a particular size.
Or remove |ipad so the full feature set works on ipads (but not iphones).
Note that the code above may need tweaking as new devices come into use.
To do this, go to Design / Library / Layouts / Zoom Image Layout / Magic Zoom Support and look for the line:
Code: Select all
$(document).ready(function(){
Code: Select all
// additional code to disable Zoom and Expand when using a touch device
var deviceAgent = navigator.userAgent.toLowerCase();
var isTouchDevice = ('ontouchstart' in document.documentElement) ||
deviceAgent.match(/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/);
if ( isTouchDevice )
{
$( "a[id^='mz-']" ).each(function(){$(this).attr('rel', 'disable-zoom:true;disable-expand:true;');});
}
Or remove |ipad so the full feature set works on ipads (but not iphones).
Note that the code above may need tweaking as new devices come into use.