Not exactly sure what you are saying as far as the selectors go, but a
plugin should work for now and can be called like:

$('.myClass').cssAnimate({params});

and the params should have to be what is in the style sheet and the set the
end animation points, ie:

assuming the css is:
.myClass{
position:absolute;
left: 0px;
top:0px;
}


var params = {
left : 50,
top : 100
}

And when $('.myClass').cssAnimate(params); is called, everything with
'myClass' will be moved 50x100.

Ultimately the only limitation to this, as I see, is the support for the
styles.


On 7/9/07, Scott Sauyet <[EMAIL PROTECTED]> wrote:


Jeroen Coumans wrote:
> On Jul 5, 9:56 pm, Scott Sauyet <[EMAIL PROTECTED]> wrote:
>> I don't want to discourage you from trying, but I think it's more
>> complicated than this.  Specificity has to do with the number of id's,
>> the number of classes (and pseudo-classes), and the number of elements
>> in the selector.  For instance,
>
> Simple fix: provide a CSS file with the plugin which the author can
> integrate themselves. Then selectors can be made as specific as
> needed, and it would enable lots of CSS-savy designers with little
> Javascript skills to customize the effects.

The problem is that the CSS and the JQuery selectors used are unique to
users' sites or even pages.  There is no clear way to make selectors
that will have a higher specificity than every selector in the user's
stylesheet.  The advantage of how JQuery (and most all JS tools I've
seen) apply styles is that they do it at the DOM level, which will
override what's in any other stylesheets.

I think Gordon's suggestion of using "!important" is enough to make the
difference, and Sean's implementation using that is already pretty
strong.  There is a ways to go towards making a generically useful
plugin, but the proofs of concept are already quite impressive:

     http://www.sunsean.com/cssAnimate.html
     http://www.sunsean.com/animatetest.html

The thought of incorporating this into the core is intriguing, but I'm
guessing it would be rather difficult, and it does run into the issue
that other "!important" declarations would interfere.  For now, I'd love
to see a useful plugin that would allow us to use this where appropriate.

   -- Scott




--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com

Reply via email to