animateClass in dev-branch: Names for the new options and code review
Hello,
the animateClass Plugin is quite final now. The only things to do is
naming, documentation of the new features and a little code review by
a third UI developer.
I introduced the following new options:
'clearInlineStyles' [boolean: false]: this option ensures, that
currently bound inline-styles won´t override any (animation) styles
defined in an external stylesheet. (technically: all inline styles
will be deleted before the newStyle-object is collected.)
'animateChilds': allows you to reference descendant-elements, wich
should be also animated
'filterCallback' [function]: this is an advanced, but very usefull
feature. it allows the author to manipulate the animateStyles-object
and resetStyle-string before these are passed to the jQuery´s animate-
method. This is usefull, if you wan´t to animate an element, wich has
also dynamically added inline styles, wich can´t be referenced in a
stylesheet. (for example you are positioning the top/left values of an
alert-box with JavaScript and then want to animate it with
animateClass.)
The this keyword in the filterCallback points to the DOM-object and
the filterCallback is passed one argument with an object, that has the
following propterties:
animateStyles: object with all Styles, wich should be animated,
resetStyle: string with the styles, that should be attached when the
animation is finished (normally an empty string (whitespace for IE8))
as an addition there are three extra properties:
element: an jQuery-Object,
newStyle: an object with all collected styles,
oldStyle: an object with all collected styles
the difference between newStyle and oldStyle is the basis of the
animateStyles-object.
you can find a demo/visual test @
http://jquery-ui.googlecode.com/svn/branches/dev/effects/tests/visual/animateClass/
The following tickets are fixed in this version: http://dev.jqueryui.com/ticket/3939,
http://dev.jqueryui.com/ticket/3938, http://dev.jqueryui.com/ticket/3937,
http://dev.jqueryui.com/ticket/3112
As I´m very new to jQuery UI Dev it would be usefull, if someone could
make a code review before merging to trunk.
regards
alex