I used this code in the footer:
<script type="text/javascript">
var pixelRatio = window.devicePixelRatio || 1;
if(window.innerWidth/pixelRatio < 641 ) {
easy_fancybox_handler = function(){
var fb_IMG_select = 'a[href*=".jpg"]:not(.nofancybox), area[href*=".jpg"]:not(.nofancybox), a[href*=".jpeg"]:not(.nofancybox), area[href*=".jpeg"]:not(.nofancybox), a[href*=".png"]:not(.nofancybox), area[href*=".png"]:not(.nofancybox);
jQuery(fb_IMG_select).attr('target','_blank');
};
};
</script>
Caused a fatal error with autoptimize.
My site doesn't use widgets but I assume it would do the same thing.
Is there another way to disable fancybox on small screens?