Welcome to WebmasterWorld Guest from

Forum Moderators: open

detect when printing with javascript

how can I detect when print stylesheet is active

7:16 pm on Mar 22, 2007 (gmt 0)

10+ Year Member

Hi folks,

I'm having a problem with a print stylesheet breaking because of a dynamic javascript div resize. You can see the details here:


I've tried to detect the css display of certain page elements in order to determine if the page is printing, but for some reason I'm getting the values of the screen css, even when printing.

Is there some way I can detect when the user is printing, or when the print stylesheet is active, using javascript? I know about onBeforePrint, but that's IE only, and this problem only happens in Firefox.

Thanks for any help.


Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved