Is there a cross browser way that I can fire an event after printing using javascript?

So I need to be able to print the jQuery interface dialog box. My solution so far has led me to create the Print button, which creates a new one <iframe>, filled with the contents of the dialog box, and then prints it.

I want to delete <iframe>as soon as printing is complete. Is there any way to do this? I know there is an onAfterPrint event in IE, but I need it to work in all browsers.

Thank!

Edit: I appreciate the alternative suggestions, however I ran into various problems trying to use CSS rules to print jQuery dialogs. On pages with a lot of content and several dialogs, the structure of the overlay and other elements will lead to printing of extra blank pages. I tried many combinations {visibility: hidden; } and {display: none; }, but could not find a solution.

+3
source share
1 answer

media = "print"? , , , reset . (, reset )

+5

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


All Articles