The problem is that html2canvas takes a screenshot of the entire selector (in this case, the body), which is specified. And how to make it so that there is only a screenshot of the part of the page that is visible on the screen? If you specify the width and height corresponding to the size of the screen, you get a screenshot of the top of the page, the size of the screen. I hope that clearly stated the essence of the problem. Help :)
$("#scrShot").click(function(){ html2canvas($("body"), { //width: document.documentElement.clientWidth, //height: document.documentElement.clientHeight, onrendered: function(canvas) { var myImage = canvas.toDataURL(); window.open(myImage); } }); }); PS Ideally, this screenshot should be immediately opened on canvas for editing. But this is still minor.