我有一个打印页面按钮,但点击一次后它无法正常工作。这是我的代码
$('body').css('overflow', 'hidden');
$('html').animate({ scrollTop: 0 }, 'fast', 'swing', function () {
var printContents = document.getElementById("shipping-reservation-
summary").innerHTML;
var originalContents = document.body.innerHTML;
document.body.innerHTML = printContents;
window.print();
document.body.innerHTML = originalContents;
return false;
})