I\'m trying to use HTML2Canvas to render the contents of a div. Here is the code:
var htmlSource = $(\'#potenzial-page\')[0];
$(\'#btn\').on(\"click\", fun
I used window.scrollTo()in my case and it worked for me.
Below is a sample code
$('#btn').on("click", function() {
window.scrollTo(0,0);
html2canvas(htmlSource).then(function(canvas) {
var img = canvas.toDataURL();
window.open(img);
});
window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight);
});