Forum Moderators: open

Message Too Old, No Replies

print function

but not the whole page

         

buksida

8:38 am on Jan 6, 2005 (gmt 0)

10+ Year Member



Currently using javascript:window.print(); to offer a print function from a website. I would like to print only the content part of the page and not the header or menu.

Don't really want to recode the site with includes so was wondering if the javascript function can be modifed to print only a certain part of the page.

adni18

1:34 pm on Jan 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could make an iframe, then cut off the headers and footers using the document.body.innerHTML element and the substring {or split} method to isolate the middle, then print just that Iframe. Or you could include:

<STYLE media="print">
<!--Then, put the class names of the header and footer here--> {display:none}
</STYLE>

in your script.