Autoptimize and other minimizer plugins compatibility
-
Could you try to make this plugin compatible with Autoptimize and other css/js minimizers out there?
The problem is that you’re creating a Javascript block on the webpage source code:
<script type="text/javascript">/* */ var fb_timeout = null; var fb_opts = { 'overlayShow' : true, 'hideOnOverlayClick' : true, 'showCloseButton' : true, 'centerOnScroll' : true, 'enableEscapeButton' : true, 'autoScale' : true }; var easy_fancybox_handler = function(){ /* IMG */ var fb_IMG_select = 'a[href*=".jpg"]:not(.nofancybox,.pin-it-button), area[href*=".jpg"]:not(.nofancybox), a[href*=".jpeg"]:not(.nofancybox,.pin-it-button), area[href*=".jpeg"]:not(.nofancybox), a[href*=".png"]:not(.nofancybox,.pin-it-button), area[href*=".png"]:not(.nofancybox)'; jQuery(fb_IMG_select).addClass('fancybox image'); var fb_IMG_sections = jQuery('div.gallery'); fb_IMG_sections.each(function() { jQuery(this).find(fb_IMG_select).attr('rel', 'gallery-' + fb_IMG_sections.index(this)); }); jQuery('a.fancybox, area.fancybox, li.fancybox a:not(li.nofancybox a)').fancybox( jQuery.extend({}, fb_opts, { 'transitionIn' : 'elastic', 'easingIn' : 'easeInBack', 'transitionOut' : 'elastic', 'easingOut' : 'easeOutBack', 'opacity' : false, 'hideOnContentClick' : false, 'titleShow' : true, 'titlePosition' : 'inside', 'titleFromAlt' : true, 'showNavArrows' : true, 'enableKeyboardNav' : true, 'cyclic' : false }) ); } /* */</script>
This script needs to have jQuery loaded before and most optimizing plugins will move the combined javascript file to the bottom, which breaks Easy Fancybox. Couldn’t this block code be moved to a file or at least use
document.ready
?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Autoptimize and other minimizer plugins compatibility’ is closed to new replies.