Chapter 18. Dynamic CSS

In the previous chapters we've looked at ways to change specific CSS attributes for specific effects, such as showing and hiding objects and moving objects across the screen. However, you can make changes to any of the CSS properties available. As a result, you can dynamically control your CSS in the browser window by making changes to styles, with these changes becoming visible immediatelyusing dynamic CSS.

For many years, the full power of dynamic CSS techniques was stymied by the fact that very few of them worked in Netscape Navigator 4. However, now that Netscape 4 makes up less than 1 percent of the browser market, a whole new horizon of dynamic techniques is open to Web designers (unless, of course, you know that a significant portion of your likely audience is using Netscape 4).

In this chapter, you'll learn how to treat style sheets as objects to accomplish the following:

  • Add and remove CSS declarations

  • Change an object's class value, to change its appearance on the fly

  • Enable or disable entire style sheets

However, let's first take a look at how to find CSS property values using JavaScript without first having to initialize them.

CSS, DHTML and Ajax. Visual QuickStart Guide
CSS, DHTML, and Ajax, Fourth Edition
ISBN: 032144325X
EAN: 2147483647
Year: 2006
Pages: 230

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: