0

i am using the famous plugin magiczoomplus to allow zoom feature. However i want to disable this on mobile.. I could not find any documentation anywhere about how to destroy magicZoomplus.

Basically the plugin looks for any element with the class magiczoomplus to initialise and is loaded in the header.

Basically i cannot even remove the class before the event is initialised..

What i am looking for is something like:

 if($(window).width()<1024){
   $(".magicZoomplus").destroy();
 }

Can anyone please help..

wasiim_dev
  • 1,057
  • 1
  • 9
  • 22

1 Answers1

1

Alright, you want to stop MagicZoomPlus from occuring when an user is on a mobile device.

To check for a mobile device, the following javascript is recommended:

if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 
// code here..
}

..and to stop MagicZoomPlus from running, simply call the event .stop():

MagicZoomPlus.stop();

Complete code snippet:

if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) { 
   MagicZoomPlus.stop();
}
urbz
  • 2,663
  • 1
  • 19
  • 29