I managed to find some of the code I was looking for. You can specify the media on a
stylesheet (below). This was giving me some troubles, as trying to print the content
area, and not navigation along with it acted odd, keeping the whitespace of all the
navigation junk in place. I think the best solution might be to use the event
handlers to edit the body innerhtml to swap it for printing.
<html>
<head>
<title>Untitled</title>
<style type="text/css" media="screen">
.noshow {visibility: hidden}
.show {visibility: visible}
</style>
<style type="text/css" media="print">
.show {visibility: hidden}
.noshow {visibility: visible}
</style>
</head>
<body>
<div class="show">This will be visible on the screen, but not on a
printout.</div>
<div class="noshow">This will be visible on the printout, but not on
the screen.</div>
</body>
</html>
>>> Dave Watts <[EMAIL PROTECTED]> 07/01/02 02:32PM >>>
> This was in steve druckers presentation at CFUN, and I can't
> find the syntax anywhere.
>
> I need to know the style for stopping a bit of text from
> printing. For instance below, all of this would show on the
> screen but not on the printed page:
>
> <span style="...">Don't Print This</span>
> <span style="...">Do Print This</span>
If I recall correctly, you can do this by using the onbeforeprint and
onafterprint events of the document itself. You'd bind those event handlers
to the BODY tag, and have those event handlers programmatically hide and
show the elements you don't want to print. So, you might have something that
looks like this:
<body onbeforeprint="hideStuff();" onafterprint="showStuff();"> ...
Then, within the hideStuff function, you'd manipulate the styles of the
things you don't want to show, changing their "visible" property to hide
them, and you'd do the reverse in the showStuff function. I may be off on
some of the details, though, since it's been a while since I've looked at
this.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists