Enhancement suggestion: .css(['prop', 'prop', 'prop']);

Enhancement suggestion: .css(['prop', 'prop', 'prop']);


At work when I was writing my own JavaScript framework (partly inspired
in API by jQuery) I ran into a number of times where I needed to grab a
series of css values and set them all onto another, as a result I ended
up coming up with another type of input to .css;
$(someNode).css(['backgroundColor', 'backgroundImage', 'width', 'height', 'position', 'top', 'left']);
Basically I made .css accept a single array of property names to grab.
The return is a object with property keys and values set on them. The
absolute beauty of this, was that you could take that same object and
set it onto another note, or even use it to revert.
var cssCache = $(node).css(['display', 'width', 'height']);
// Do a bunch of stuff to node that modifies all that kind of css.
$(node).css(cssCache); // Revert to the original values
Though I do take note now, another possibility which might fit in better
with .addClass and .bind might be something like.
$(someNode).css('backgroundColor backgroundImage width height position top left');
Though the fact that the difference between 'width' and 'width height'
is the difference between .css returning a string or an array, so it
might be worth it to use the array input format to avoid confusion.
Any thoughts? This worth opening an enhancement ticket?
--
~Daniel Friesen (Dantman, Nadir-Seen-Fire)