• 打印CSDN博客内容JS


    https://blog.csdn.net/jdy_lyy/article/details/102923471

    使用如下代码,先进入到打印界面

    (function(){
    $("#side").remove();
    $("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
    $(".nav_top_2011, #header, #navigator").remove();
    $(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
    $("aside").remove();
    $(".csdn-side-toolbar").remove();
    $(".tool-box").remove();
    $("main").css('display','content'); 
    $("main").css('float','left'); 
    
    $("tool-box").remove();
    })();
    

      

    使用如下代码,进行正式打印

    https://www.jianshu.com/p/5b43a2a8081e

    (function(){
    $("#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").remove();
    $("aside").remove();
    $(".tool-box").remove();
    $("main").css('display','content');
    $("main").css('float','left');
    $("#mainBox").css('width','1048px');
    $("#mainBox").css('margin-left','0px');
    $("#mainBox").css('margin-right','0px');
    //$("[class='main_father clearfix d-flex justify-content-center']").css("width","1048px");
    $(".main_father.clearfix.d-flex.justify-content-center").css("width","1048px");
    window.print();
    $("tool-box").remove();
    })();
    

      

    (function(){
    $("#side").remove();
    $("#comment_title, #comment_list, #comment_bar, #comment_form, .announce, #ad_cen, #ad_bot").remove();
    $(".nav_top_2011, #header, #navigator").remove();
    $(".p4course_target, .comment-box, .recommend-box, #csdn-toolbar, #tool-box").remove();
    $("aside").remove();
    $(".csdn-side-toolbar").remove();
    $(".tool-box").remove();
    $("main").css('display','content'); 
    $("main").css('float','left'); 
    
    $("tool-box").remove();
    })();
    
    (function(){
    $("#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").remove();
    $("aside").remove();
    $(".tool-box").remove();
    $("main").css('display','content');
    $("main").css('float','left');
    $("#mainBox").css('width','1048px');
    $("#mainBox").css('margin-left','0px');
    $("#mainBox").css('margin-right','0px');
    //$("[class='main_father clearfix d-flex justify-content-center']").css("width","1048px");
    $(".main_father.clearfix.d-flex.justify-content-center").css("width","1048px");
    window.print();
    $("tool-box").remove();
    })();
    

      




    Le vent se lève! . . . il faut tenter de vivre!


    Le vent se lève! . . . il faut tenter de vivre!
  • 相关阅读:
    IntlliJ IDEA 注册码获取或离线破解
    selenium元素定位
    appium元素定位
    django模型之meta使用
    django 之admin使用
    django之models模块使用
    Django的httprequest对象和httpresponse对象
    parameterized之unittest参数化
    HTMLTestRunner不生成报告
    collections之python基本应用
  • 原文地址:https://www.cnblogs.com/bai2018/p/14901566.html
Copyright © 2020-2023  润新知