Thu, 2004-04-22 23:38
I'm developing a site for a client, and one of the pages is a lengthy legal contract. I have an option to view a printable version of the site if they want to print it out.
I already have specified an alternate stylesheet on each page for print media, but I want something that the user can select through a link and quickly switch the stylesheet. Is there an elegant way to do this? I've tried the ALA javascript but I'm convinced there has to be a simpler way. If anybody has any tips it would be much appreciated.
Mon, 2004-04-26 21:47
#1
One-time style switching with a link
It's simple if you're using server-side scripting.
For example with php, you could create a link "page.php?layout=print"
and in the page.php file:
if ($_GET["layout"] == "print") // use the print style css file else // use the normal style css file
Tue, 2004-04-27 10:47
#2
One-time style switching with a link
If your pages aren't PHP however, javascript is the easiest way to go about things.