Forum Moderators: open

Message Too Old, No Replies

How do I print all DIVs on a page?

Need help!

         

Carl

4:27 am on Aug 3, 2004 (gmt 0)

10+ Year Member



I'm having a problem with printing using JavaScript. I have a pop-up window that displays a printable version of some contacts. The page that is output makes use of DIVs and CSS to control layout.

The pop-up window has two frames: a frame for the contacts and a frame with a print button and a close button. I've been able to print the main frame if there aren't any DIVs present and if there is only one DIV present with the following function:


function MyPrint()
{
parent.mainFrame.focus();
parent.mainFrame.print();
}

What I want to do is modify the above function to print all the DIVs in my pop-up window. I've done a TON of searching on Google and have been unable to find anything that might point me in the right direction. I really need some help. Thanks in advance!

RonPK

11:17 am on Aug 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not really an answer to your question, but if frames are giving you problems, why not drop them. Put the buttons in a non-printing div, if you don't want them printed.

@media print { div#buttons {display: none;} }