Thanks!

What do people say about possibly adding this to work within jQuery.
Instead of hard coding in the px's, we can just use CSS.

Instead of
  $(...).animate({top: '30px', width: '500px'})
we can just
  $(...).animate({css: 'shrunk'})



On Nov 4, 3:01 pm, Stefan Petre <[EMAIL PROTECTED]> wrote:
> S. Robert James wrote:
> > While working on 
> > this:http://groups.google.com/group/jquery-en/browse_thread/thread/7cbc9fb...
> > , 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