Viewing 1 replies (of 1 total)
  • Thread Starter mioswebdesigns

    (@mioswebdesigns)

    I found a workaround but it involves editing plugin code which is not ideal because it will get overwritten in plugin updates:

    Dashboard > Plugins > Editor > select ‘Fancybox for WordPress’ from dropdown menu > click ‘Select button

    Edit plugin file: fancybox-for-wordpress/fancybox.php

    Look for echo "\n<!-- Fancybox for WordPress v" . $version . ' -->'; ?> near line 222. Just below that you should see <script type="text/javascript">. Just after that opening script tag add if (window.innerWidth > 500) {

    Next look for </script><?php echo "<!-- END Fancybox for WordPress -->\n"; near lines 314-315. Just above the closing script tag, add your ending curly brace for the if statement.

    This prevents fancybox from initializing on page load if inner width of screen is smaller than 500px. Not ideal but effective.

Viewing 1 replies (of 1 total)
  • The topic ‘Disable on smaller screens’ is closed to new replies.