[Plugin: FancyBox for WordPress] Patch: Disabling fancybox on selected images
-
I needed to disable fancybox on certain images and after finding that this isn’t possible with the default plugin, I dug into the code and patched it (version 3.0.1).
Find:
// Supported file extensions var thumbnails = jQuery("a:has(img)").filter( function() { return /(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr('href')) });
Add after jQuery(“a:has(img)”):
.not(".nolightbox")
Final result:
// Supported file extensions var thumbnails = jQuery("a:has(img)").not(".nolightbox").filter( function() { return /(jpe?g|png|gif|bmp)$/i.test(jQuery(this).attr('href')) });
Now, in your post’s HTML, add class=’nolightbox’ and optionally target=’_new’ to the
<a>
element, and it will no longer be fancyboxed.Enjoy!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘[Plugin: FancyBox for WordPress] Patch: Disabling fancybox on selected images’ is closed to new replies.