Why won't @media print with declarations like this work?:
.hide-on-print {
display: none;
}
Alternatively, you can use this jquery plugin: http://projects.erikzaadi.com/jQueryPlugins/jQuery.printElement/ and just set up the print document in a div and print that, however that would require a print link. It would be possible to create a div off screen and load that up with the content you want to print, and then print that div with the jquery. Blowsie's answer essentially does this in a new temporary browser window. However, this method sounds like some heavy JS lifting and will delay the performance of the print function until the javascript finishes executing. Again, all of these javascript solutions require a Print link to work--they will not work if the user does File->Print or Ctrl+P.
If you are trying to catch the Print event with JavaScript, that can only be done in IE through use of window.onBeforePrint and window.onAfterPrint, as you already know. There is currently no way to catch this event in Mozilla and Webkit browsers. For print styling they recommend @media css and do not believe in interfering with the Print functionality via javascript.
I strongly recommend the former method--the css. It's the most cross-browser compatible and the most predictable. Your styles will only be applied at print time and will not be visible in the browser, only on the printed page. Using the javascript/jquery method the user may get a flash of changing styles of content (or in Blowsie's example, see a pop-up window or worse, have popups disabled and the method fail), and suffer a poor user experience in buggy and inconsistent print functionality.
This question is a common one and has also been answered here: Javascript Event Handler for Print