Skip to content

Instantly share code, notes, and snippets.

@usctrojan
Created March 9, 2015 19:35
Show Gist options
  • Select an option

  • Save usctrojan/f7efdc953ce216bc2186 to your computer and use it in GitHub Desktop.

Select an option

Save usctrojan/f7efdc953ce216bc2186 to your computer and use it in GitHub Desktop.
<input type="submit" value="Take Screenshot Of Div" onclick="capture();" />
<form>
<input type="hidden" name="img_val" id="img_val" value="" />
</form>
<% content_for :foot do %>
<script type="text/javascript" src="js/html2canvas.js"></script>
<script>
function capture() {
html2canvas( [ document.body ], {
onrendered: function(canvas) {
document.body.appendChild(canvas);
}
});
}
</script>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment