The problem occurs when trying to determine the 'start' value. getComputedStyle explodes 'padding' into its four individual components. If you want to animate padding (or margin), you either have to specify each one in the first argument, or explicitly set the initial padding on the element (as opposed to via a stylesheet).
On May 21, 12:16 pm, Liam Byrne <l...@onsight.ie> wrote: > Maybe I'm wrong, but I think > > myElement.animate( {padding: 12px} ) > > won't work anyway ? Shouldn't it be > > myElement.animate( {padding: 12} ) > > That said, tests here show that only IE & Opera offer a smooth animation > - the others (FF, Chrome & Safari) seem to jump > > L > > Jason Persampieri wrote: > > (Firefox 3.0.10, OS X) > > > I am setting a padding value via a stylesheet and trying to animate it > > - > > > - CSS > > myElement { padding: 20px } > > > - Javascript > > myElement.animate( {padding: 12px} ) > > > When calculating the start padding value, jQuery calls > > 'getComputedStyle'. Unfortunately, > > > computedStyle.padding = "" > > computedStyle.padding-top = "20px" > > computedStyle.padding-right = "20px" > > computedStyle.padding-bottom = "20px" > > computedStyle.padding-left = "20px" > > > and the call to 'getPropertyValue' returns an empty string (which is > > translated to 0px). > > > Would this be considered a jQuery or Firefox issue? > > ------------------------------------------------------------------------ > > > No virus found in this incoming message. > > Checked by AVG -www.avg.com > > Version: 8.5.339 / Virus Database: 270.12.36/2126 - Release Date: 05/21/09 > > 06:22:00