I suggest that if you're going to include CSS in your JS, only do what's necessary for the functionality (z-index, & positioning are great examples); leave the *styling* to an external file where it belongs.
Jörn Zaefferer wrote: > Nate Cavanaugh schrieb: >> Any thoughts before I give this a go? I don't want to waste an hour doing >> something if someone else has tried it and found it impossible. > I prefer a mixed approach: > > Hardcode any necessary styles with JS. For example, a tooltip[1] needs > absolute positioning and a resonable high z-index. > > Style everything else via stylesheets, using IDs and classes: There can > by only one tooltip instance at a time, so it is safe to give it an ID > (#tooltip). Subelements of the tooltip are referenced by tag names or > classes (h3, p.body, p.url). The plugin allows to add extra classes to > the tooltip when applied to certain elements, allowing you to give one > tooltip several styles. > > I think Stefan Petre (Interface) prefers the JS approach: Put everything > into JS, require no additional CSS files. Works quite well, too, and is > easier to manage with lots of plugins used. > > [1] http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/ > _______________________________________________ jQuery mailing list [email protected] http://jquery.com/discuss/
