Skip to content

Instantly share code, notes, and snippets.

@bearloga
Created September 28, 2016 19:22
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bearloga/9c44441a66c5a2498577cea67346e0c9 to your computer and use it in GitHub Desktop.
Save bearloga/9c44441a66c5a2498577cea67346e0c9 to your computer and use it in GitHub Desktop.
Make the figures click-able in your RMarkdown=>HTML reports.
<script language="JavaScript">
$(function() {
/* Lets the user click on the images to view them in full resolution. */
$("div.figure img").wrap(function() {
var link = $('<a/>');
link.attr('href', $(this).attr('src'));
link.attr('title', $(this).attr('alt'));
link.attr('target', '_blank');
return link;
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment