[Javascript] enabling print stylesheets on screen

Paul Novitski paul at novitskisoftware.com
Wed Mar 15 11:12:00 CST 2006


At 08:52 AM 3/15/2006, Steve Clay wrote:
>I want to dynamically load any print media CSS files as screen files
>as a sort of emulation of "print preview". I realize I won't be able to
>affect any @media print {} blocks, but I'm willing to live with that.


Without testing, I'd guess that if you linked your stylesheets like this:

<link rel="stylesheet" type="text/css" media="screen" href="screen.css" />
<link rel="stylesheet" type="text/css" media="print"  href="print.css" />

...then you could use JavaScript to modify the media attribute, 
changing "print" to "screen" and "screen" to "xscreen" (or something 
else that would be ignored).

Paul 




More information about the Javascript mailing list