Incomplete screenshots using html2canvas, scroll bar dragging issues
Before processing, if the page is very long, you need to set the scroll bar to the top, and then call the method
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;、、
part of the code
window.pageYoffset = 0;
document.documentElement.scrollTop = 0;
document.body.scrollTop = 0;
html2Canvas(document.querySelector('#id'), {
allowTaint: false,
logging: false,
useCORS: true
}).then(function (canvas) {
//进行操作
})