如何打印csdn的文章

如何打印csdn的文章

转自 https://www.cnblogs.com/jiangkejie/p/13221446.html 

转自 https://blog.csdn.net/p1279030826/article/details/106602341

 

使用方法:按“F12” (在浏览器工具栏右击下拉 “更多工具”中) 进入开发者工具,将以下js复制到 console,回车即可一键打印。 

功能:

  • 1、自动“展开阅读全文”
  • 2、删除顶栏、侧栏、相关文章展示、浏览信息、广告、点赞等多余信息。真正的全清爽模式。
  • 3、自动输出打印预览

 

(function(){
    'use strict';
    var articleBox = $("div.article_content");
    articleBox.removeAttr("style");
    $("#btn-readmore").parent().remove();
    $("#side").remove();
    $("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
    $(".nav_top_2011, #header, #navigator").remove();
    $(".csdn-side-toolbar,.template-box,.reward-user-box").remove();
    $(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box,#dmp_ad_58, .more-toolbox, .article-info-box, .btn-readmore").remove();
    $("aside").remove();
    $(".tool-box").remove();
    $("main").css('display','content');
    $("main").css('float','left');
    $("#mainBox").css('width','100%');
    $(".main_father.clearfix.d-flex.justify-content-center").css("width","100%");
    window.print();
})();

  • 2
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值