posted 15 years ago
Some of our web application pages contain page onresize code based on the jQuery library that optimally adjusts the header/content/footer divisions of a page. Basically, the header and footer are allowed to expand to whatever height they need to be completely visible and the remaining height is allocated to the content division (which may overflow). The page itself is not allowed to overflow.
The problem is that is causing a problem in printed pages. Print CSS styles exist to set margin and height to auto when printing so any content within the content division will be printed regardless of whether it is visible on the page or not, i.e. overflowed. However, the page onresize code is changing element style attributes when adjusting the height of the divisions. I believe if the code changed the applicable default display CSS style rule rather than setting the style attribute itself, this approach may solve the problem.
However, I am relatively new to jQuery. I have looked at the documentation but it appears that the .css function ultimately changes the style attribute as well. Is there a jQuery function to change the CSS rule itself? Or is there possibly another solution?