打印网页需要的页面(备忘)
转 https://jerrycoding.com/article/csdn-print
很多素材或者资料只需要有用的,没用太多,看着花眼
对网页编程不熟啊,我修改了’margin-left’,’-500px’ 靠左打印,右边方便书写记忆。
(function(){
$("#side").remove();
$(".toc").remove();
$("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
$(".nav_top_2011, #header, #navigator, .blog-footer-bottom").remove();
$(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
$("aside").remove();
$(".tool-box").remove();
$(".more-toolbox").remove();
$("#dmp_ad_58").remove();
$(".csdn-side-toolbar").remove();
$("main").css('display','content');
$("main").css('float','left');
$("main").css('width','1000px');
$("main").css('margin-left','-500px');
window.print();
})();