<p>I'm trying to dynamically hide certain DIV's when a print (or print preview) occurs from the browser.</p>

<p>I can easily differentiate statically by having two style sheets, one for normal and one for print media:

</p>

<p>But I need to go one step further and hide some elements dynamically when the print style sheet becomes active during a print based upon certain criteria</p>

<p>One way to easily solve it would be to handle a DOM event for handling print / printview, then I could just use jQuery to change the display:none on the classes that need to be hidden, but I can't find a DOM print event!!</p>

<p>Anyone know what the solution is?</p>

There's an
onbeforeprint
event in IE. It doesn't appear to be supported by other major browsers. (I tested Firefox 3.0.3 and Safari 3.1.2.)