Forum Moderators: open

Message Too Old, No Replies

Javascript min-height trick muddles on print

Is there any way to disable it on print/print preview?

         

Setek

4:57 am on Jan 31, 2007 (gmt 0)

10+ Year Member



I have a script that gets the height of three columns, and sets the one in the document flow (the others are absolutely positioned) to the height of the tallest column.

On print/print preview, the styles get changed according to the print stylesheet - and the need for the three columns and the height script is gone - but the script or the print preview is actually grabbing the content of the document after the script has run.

Has anybody encountered this, and know of a way to fix this? :)

Cheers

mrhoo

8:34 pm on Jan 31, 2007 (gmt 0)

10+ Year Member



Best way is to change layout styles in a stylesheet, and not inline with element.style= statements.

You can use script to dynamically create a new stylesheet with media='screen' to position your elements, which won't get used when printing.

Setek

12:34 am on Feb 1, 2007 (gmt 0)

10+ Year Member



Best way is to change layout styles in a stylesheet, and not inline with element.style= statements.

Yep, I know it is, just in this case for accessibility I had to absolutely position one of the columns - which takes it out of the document flow - which, if being the tallest column, will overlap the footer which still is in the document flow.

You can use script to dynamically create a new stylesheet with media='screen' to position your elements, which won't get used when printing.

Ooh, that's a good idea, I might try that. Thanks! :)