Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] enabling print stylesheets on screen


  • From: paul at novitskisoftware.com (Paul Novitski)
  • Subject: [Javascript] enabling print stylesheets on screen
  • Date: Wed Mar 15 11:12:22 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