Window.print in jquery

I have a scrollable jquery dialog. I want to print the contents of a dialog box. If I use the window.print() method, it just prints the displayed content. The rest of the scrollable content cannot be printed. Please help me solve this problem.

+4
source share
1 answer

If I understand your problem correctly, it means that you have a scrollable div , say 200px high, but the content in it is 1000px high, and you want all the div content to display when the page prints.

If this is correct, you will need to specify a stylesheet for use in reception. As an example, try adding this to the top of your page:

 <style type="text/css" media="print"> #myScrollableDiv { overflow: visible; height: auto; } </style> 

Depending on the structure of your CSS, you may need to add !important flags to each of these statements.

+3
source

Source: https://habr.com/ru/post/1381459/


All Articles