Quantcast
Channel: Topic Tag: mobile | WordPress.org
Viewing all articles
Browse latest Browse all 22090

carolemagouirk on "[Plugin: Easy FancyBox] Disable fancybox for smalll screens"

$
0
0

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?


Viewing all articles
Browse latest Browse all 22090

Trending Articles