Previous Message
Next Message

User Defined Print CSS

Sent by Paul Debban on 30 September 2005 16:04


On 9/30/05, Shane [EMAIL-REMOVED]> wrote:
> ...Is is possible to have multiple user selectable print
> stylesheets such as a "content only" and a "full page layout"? ...

In my opinion, the most robust method of accomplishing this would be
to set a session variable on your server and serve the appropriate
print style sheet based on the user selection.

An alternative method is to use Javascript to switch between
alternative print style sheets. You would need a cookie or a style
sheet selection widget to choose style sheets and a function to switch
print style sheets. I have had success doing this with IE and FireFox
(change print stylesheet url in IE, set disabled property in Firefox),
but I couldn't get Opera to return a document.styleSheets collection
to manipulate and I have no Mac for testing.

An article on alistapart accomplishes stylesheet switching using
document.write. XHTML isn't supported, but it is probably the most
reliable cross-browser method of switching print stylesheets using
Javascript: http://www.alistapart.com/articles/n4switch/

---
Paul Debban
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Previous Message
Next Message

Message thread: