Hello, I didn't find any solution for my problem yet. Can anyone help me ?
I have a JS object defining CSS properties. I'd like to remove from this object all the properties that can't be animated. example : I have this object : var myObject = { height: '100px', width: '100px', color: 'red', 'margin-top': '25px', overflow: 'auto' } I want to get only the properties I can use to make an animation, so the result should be : var myObjectFiltered = { height: '100px', width: '100px', 'margin-top': '25px' } But I know jQuery plugins can add some animations possibilities, like animating colors for example. In this case the result should be : var myObjectFiltered = { height: '100px', width: '100px', color: 'red', 'margin-top': '25px' } anyone knows how to do this ? thanks Nico > I'm coding a jQuery plugin to draw modal windows. In this plugin, I > make animations to show and hide the modal window. > I'd like my plugin to be as much customizable as possible. So I want > the animations to be customizable also. To do this, I have one option > for the general css properties (the style of the window), one for css > properties before "showing" animation, and one for css properties > after "hidding" animation. > > To make the "show" animation, I start by applying general style + > before styles (before styles overwrites general styles). Than I get > the difference between before styles and general styles,, and I use > this object as the animation properties. > > To make the "hide" animation, the general styles are already applied, > I just launch an animation using the "after hiding styles" as the > animation properties. > > All this works very well, but I have just one small problem : All css > properties can't be used as animation properties. And if I try to > launch an animation with a "non-animable" css property, than the > animation bugs. > So I have to filter the properties I give to the animate function, to > remove all "non-animable" properties. But to do this, I have to get a > list of "animable" css properties. > > Does someone knows how I can manage to get this list ? is there > something like this in jQuery ?