How do I print the entire bootstrap modal where content in modal body is scrolled out of view

后端 未结 5 803
我寻月下人不归
我寻月下人不归 2020-12-08 03:18

The problem is that the user has to scroll down to view all of the content within the modal body. However, when I print the modal the only part that is printed is the part t

5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-08 03:56

    Download printThis.js from the following link and include it in your html: https://github.com/jasonday/printThis/blob/0a7f799693af8a8303bf0b8df0efc80c2694af81/printThis.js

    Wrap the content you want to print with the following div. Everything outside of this div will not be printed.

    ..content to print..

    Call the following jquery to print all the content including the content that is not viewable. You may include your css files in an array if you have multiple css files.

    $("#modalDiv").printThis({ 
        debug: false,              
        importCSS: true,             
        importStyle: true,         
        printContainer: true,       
        loadCSS: "../css/style.css", 
        pageTitle: "My Modal",             
        removeInline: false,        
        printDelay: 333,            
        header: null,             
        formValues: true          
    }); 
    

提交回复
热议问题