You can also change the JS code to mate it changes the "className"
of the element, rather then changing the inline style itself.
    If the script changes the className to "hidden", for example, it
would be easy to make a print css with different definitions of the
"hidden" class.
.hidden { display: none; }
@media print { .hidden { display: block; } }

    And you're done ;)

  Amplexos.

2005/7/11, James Denholm-Price <[EMAIL PROTECTED]>:
> Hi Melissa & [EMAIL PROTECTED],
>
> On 7/11/05, Craddock, Melissa <[EMAIL PROTECTED]> wrote:
> > I am using a expanding menu based on
> > http://www.gazingus.org/html/menuExpandable.html
> >... I would like to have the menu print expanded even though it is collapsed
> > on the screen.
> > When I first go to the page, I can click on print preview and see the
> > expanded menu even though it is collapsed on the screen. If I click on
> > one of the items on the screen to expand and click on it again to
> > collapse, that item will print collapsed. In my screen stylesheet I have
> > the class set to display: none;. In the print stylesheet the display
> > none is removed, yet it still doesn't print.
>
> I guess it's because the menu JS
> <http://www.gazingus.org/js/menuExpandable3.js> (?) sets the element's
> "style.display.block" properties to "none" to hide them then you click
> ... this is hard to override in a print stylesheet as inline style
> (which is what the DOM "style" property effectively manipulates) has a
> high specificity
> <http://css-discuss.incutio.com/?page=SelectorSpecificity>
>
> You could try increasing the specificty of the print display rules by
> adding "!IMPORTANT" or more specific selectors.
>
> Ideally (IMO) we could rewrite the menu script to apply "show" and
> "hide" classes to the elements and then all you need do is override
> show and hide in the print style sheet but I appreciate this is
> harder.
>
> James
>
> PS: Google reveals a nice Brainjar article
> <http://www.brainjar.com/css/using/default4.asp>: that says
>
> "Inline Styles
>
> Style properties defined inline, i.e., within an HTML tag's STYLE
> attribute, are given the same weight that an ID selector would have.
> In terms of order, they are treated as though they occur after all
> other rules.
>
> In other words, inline styles take precedence over anything but a
> conflicting declaration in a user style sheet."

-- 
~~ ~
diego nunes
web engineer
~ ~~
______________________________________________________________________
css-discuss [EMAIL PROTECTED]
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/

Reply via email to