Reply To: PDF on iPad and iPhone

Your Account / Forums / Easy FancyBox Pro / PDF on iPad and iPhone / Reply To: PDF on iPad and iPhone

April 9, 2015 at 11:54 pm #4792

This code in a text widget should do the trick:


<script type="text/javascript">
var pixelRatio = window.devicePixelRatio || 1;
//alert('Screen size: ' + window.innerWidth + ' / ' + pixelRatio + ' = ' + window.innerWidth/pixelRatio);
if( window.innerWidth/pixelRatio < 420 ) {
  //alert('Fancybox disabled.');
  easy_fancybox_handler = null;
};
</script>

For testing purposes, remove the // in front of the alert(...) lines. It will create a message stating calculated screen width and a message if FancyBox is disabled on smaller devices. Remove those alert lines after testing.

EDIT: Oh, and change the value 420 to disable FancyBox starting from another screen size.