Skip to content

Instantly share code, notes, and snippets.

@goldsky
Created April 13, 2012 04:45
Show Gist options
  • Save goldsky/2373760 to your computer and use it in GitHub Desktop.
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.
$(document).ready(function() {
$("#content img").wrap(function() {
return '<a href="'+ this.src +'" />';
}).parent().fancybox();
});
@Mark-H
Copy link

Mark-H commented Apr 13, 2012

Now that's fancy. Thanks for sharing.

@goldsky
Copy link
Author

goldsky commented Apr 13, 2012

YW, Mark. I didn't know this would be so useful. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment