Print DIV content by JQuery

前端 未结 6 861
无人共我
无人共我 2021-02-06 03:26

suppose i have many div\'s in my page but i want to print the content of specific div using jquery. i found there is a plugin for that.

jQuery Print Element

usin

6条回答
  •  佛祖请我去吃肉
    2021-02-06 03:59

    I prefer this one, I have tested it and its working

    https://github.com/jasonday/printThis

    $("#mySelector").printThis();
    

    or

    $("#mySelector").printThis({
    *      debug: false,              * show the iframe for debugging
    *      importCSS: true,           * import page CSS
    *      printContainer: true,      * grab outer container as well as the contents of the selector
    *      loadCSS: "path/to/my.css", * path to additional css file
    *      pageTitle: "",             * add title to print page
    *      removeInline: false        * remove all inline styles from print elements
    *  });
    

提交回复
热议问题