How to take screenshot of a DIV which contain more than one images? Actually I am dragging images into DIV and want to take screenshot using Jquery or Javascript but without using server side scripting language.
Asked
Active
Viewed 1,717 times
0
-
1Try this : http://stackoverflow.com/questions/14595541/capture-div-into-image-using-html2canvas – K K Mar 17 '15 at 07:04
-
html2canvas - provided the images are on the same domain, – sideroxylon Mar 17 '15 at 07:51
1 Answers
0
Assuming you have a button to click (to trigger the capture), and that the images are on the same domain, load the html2canvas JS file, then add this:
$('#btn').click(function() {
html2canvas($('#DIV'), {
onrendered: function(canvas) {
//do something with the canvas element - upload, append to a display element, etc. For example:
var myImage = canvas.toDataURL("image/png");
window.open(myImage);
}
});
});

sideroxylon
- 4,338
- 1
- 22
- 40