[thelist] CSS print stylesheets and dynamic style changes

Francois Jordaan Francois.Jordaan at wheel.co.uk
Wed Oct 1 08:21:58 CDT 2003


Quick overview: It seems as if dynamic style changes defeat some of the
advantages of print stylesheets, as something that has been dynamically
hidden cannot be made visible on hard copy by the print stylesheet.

The Layout
-----------------
A single page with 3 divs, A, B & C.

In the style sheet, A is visible (display: block), B & C are hidden
(display: none;)
All 3 are set to visible by the stylesheet for print.

On first load of the page you see only div A, and in Print Preview you see
A, B & C.

The Problem
-------------------
We have 3 javascript buttons that are used to show/hide these divs to create
a tab effect.

The problem is that the javascript which sets all 3 to hidden and then sets
the div concerned to visible, overrides the print stylesheet.

So once we have clicked to make a different tab visible (and the javascript
had been run), the only visible div in the Print Preview is the one we
currently see on screen.

The javascript is using getElementById to target the divs and is using
'display:none' and 'display:block' for visibility.

Any ideas how to get the hidden divs to print as well?

francois

_____________________________________________________________________
This e-mail has been scanned for viruses by MessageLabs.


More information about the thelist mailing list