Created
April 13, 2012 04:45
-
-
Save goldsky/2373760 to your computer and use it in GitHub Desktop.
This snippet loads fancybox automatically to all images inside the #content area. Useful for user's images that are uploaded by TinyMCE.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$("#content img").wrap(function() { | |
return '<a href="'+ this.src +'" />'; | |
}).parent().fancybox(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
YW, Mark. I didn't know this would be so useful. :)