Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   Web Design and Hosting (http://www.mac-forums.com/forums/web-design-hosting/)
-   -   Change style sheet by javascript (http://www.mac-forums.com/forums/web-design-hosting/106855-change-style-sheet-javascript.html)

michelangelo 05-01-2008 08:12 PM

Change style sheet by javascript
 
On the website, we want to have "screen view" for viewing and "print view" for printing.

In the past and when floated objects are located on the webpage, we prepare a pdf file for that.

When no floated objects appear on the page, we want to use instead as "print view" an html view of the same page (same.html file) to reduce work and footprint on the hosting server. In other words, the "print view" is a reliable screen view of what will be printed if we print the "print view" page using the printer

We access the print view via a link called 'print view" which opens a reduced size pop-up window with a degradable javascript

The way the site is programmed today, two stylesheets exist: a standard one for screen viewing called "styles.css" and a special one for print called styles_print.css"

The print view is accessed throug a copy of the original html file "original.html" called original_print.html" and containing a link modified to point to "styles_print.css"

This is cumbersome. Could I simplify this with javascript (or else) to use only one html file (the original.html)

Example page: see <http://tinyurl.com/59m7ar>

TIA


All times are GMT -4. The time now is 06:04 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.