Print contents of a modal popup

后端 未结 4 1371
眼角桃花
眼角桃花 2020-12-22 07:26

I have an application that shows a list of items.

The user can click on an item and see its details in a modal popup (centered DIV, shown using JavaScript). I need t

4条回答
  •  生来不讨喜
    2020-12-22 07:39

    You could add a 'noprint' class name to a div wrapping everything you do not wish to print.

    If you also want the main page to be printable without the dialog you can add class name to the wrapper DIV when the user presses the PRINT button and remove the class name after.

    @media print {
    .noprint {
     display:none
    }
    }
    

提交回复
热议问题