Dave Methvin wrote: >> I ran into a number of times where I needed to grab a >> series of css values and set them all onto another, >> > > This functionality overlaps with what you were proposing in #4295 but > to me it seems like a better way to do it because you can explicitly > get the individual properties you want rather than making jQuery parse > (and the caller interpret) the complex shorthand situations. > > http://dev.jquery.com/ticket/4295 > That bug has nothing to do with the caller interpreting complex shorthands. That's a ticket for fixing a cross browser incompatibility with shorthand forms which are perfectly valid for use without using any complex forms. jQuery is supposed to keep things short and abstract browser incompatibility so I see no reason to require people to use $(node).css(['marginTop', 'marginRight', 'marginBottom', 'marginLeft']); when it's perfectly valid (and more likely) for them to try using $(node).css('margin'); which has a bug in it they are unlikely to know about. >> var cssCache = $(node).css(['display', 'width', 'height']); >> > > To make it optionally chainable I'd add the ability to pass in an > object as the second argument so you could do this: > > var saved = {}; > $(node) > .css(['display', 'width', 'height'], saved) > .something().mangling().theNode() > .css(saved); > > This particular example is really similar to the internal swap() > method though, so maybe there's some way to publish that in a > reasonable way instead. > > http://dev.jquery.com/browser/trunk/jquery/src/attributes.js#L180 > > I played with something like this a couple of years back but it just > seemed like too much code to include in the core. Perhaps the best > start is to see how it looks as a plugin. > ~Daniel Friesen (Dantman, Nadir-Seen-Fire)
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "jQuery Development" group. To post to this group, send email to jquery-dev@googlegroups.com To unsubscribe from this group, send email to jquery-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en -~----------~----~----~----~------~----~------~--~---