S
Spartanicus
Chris said:Does anyone know how to change the media of stylesheet with javscript
What are you actually trying to do?
Chris said:Does anyone know how to change the media of stylesheet with javscript
Chris said:<link rel="stylesheet" href="Footer.css" media="screen" />
to
<link rel="stylesheet" href="Footer.css" media="print" />
Chris said:I want to have a printer friendly page. My code is all css based so changing
the media type to 'print' in the style definition does what I want. So I
would like JS that changes:
<link rel="stylesheet" href="Footer.css" media="screen" />
to
<link rel="stylesheet" href="Footer.css" media="print" />
Ok.Chris said:I want to have a printer friendly page. My code is all css based so changing
the media type to 'print' in the style definition does what I want. So I
would like JS that changes:
<link rel="stylesheet" href="Footer.css" media="screen" />
to
<link rel="stylesheet" href="Footer.css" media="print" />
Regards
Chris said:I want to have a printer friendly page. My code is all css based so
changing the media type to 'print' in the style definition does what
I want. So I would like JS that changes:
<link rel="stylesheet" href="Footer.css" media="screen" />
to
<link rel="stylesheet" href="Footer.css" media="print" />
Chris said:It doesn't seem to print properly when I have it in screen mode. Also I just
think people get it more when they press a button and the screen goes into a
printer friendly page. It's like they can be sure of what they are getting
before they press print. Maybe it's just me but the amount of times I have
seen annoyed users who go to print and don't get what they want.
Beauregard said:Why don't you just use two stylesheets? Put a call to both of them in
your pages.
<link rel="stylesheet" href="Footer.css" media="screen" />
<link rel="stylesheet" href="printing.css" media="print" />
Note different name. No JavaScript necessary.
Put all styles relating to printing in the print stylesheet.
See this site of mine, and do a print preview on any of the pages.
http://countryrode.com/
My client keeps a printed copy of
http://countryrode.com/sales/preowned.php
on the counter.
Here's the print stylesheet:
http://countryrode.com/style/crprint.css
....wayne said:Or place the print settings in your normal css:
@media print {
with a separate sheet said:#content a {
text-decoration: none;
Beauregard said:...
This would work as well. I find it easier to demonstrate print styling
I tend to allow links to be underlined on the printed copy, so the
reader of the paper knows that further information would be available if
s/he went to the computer. Depends on the circumstances, though.
wayne said:Good points. Since the print copy is from the site though, I assumed
the user already knew about the links.
the paper on to someone else. said:As for using the same file, it is easier for me to have only one file
to maintain. YMMV, especially if one has multiple style sheets.
Normally, this would be the case .. unless the printing person passed
the paper on to someone else. <g>
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.