S. Robert James wrote:
While working on this: 
http://groups.google.com/group/jquery-en/browse_thread/thread/7cbc9fb45f7dc133
, I've tried to come up with a way to read attributes out of a CSS
class, even if that class isn't applied to any element.  No luck so
far.

Any jQuery pro's want to take a crack at it? Storing attributes for
animations in CSS - as opposed to JavaScript - would lean to much
cleaner code.



if (document.styleSheets) {
                for (var i=0, styleSheet; i<document.styleSheets.length; i++) {
                        styleSheet = document.styleSheets[i];
for (var k=0, lng = styleSheet.cssRules ? styleSheet.cssRules.length : styleSheet.rules.length, cssRule; k <lng; k++) { cssRule = styleSheet.cssRules ? styleSheet.cssRules[k] : styleSheet.rules[k];
                                //cssRule.selectorText may have the name of the 
class
                                //cssRule.style has the properties defined in 
the CSS for current selector
                                //so do you stuff here
                        }
                }
        }

Reply via email to