Thursday, September 3

Jquery animate() and IE8

So, I ran across a little note today in jquery. When using the animate() function, IE will not accept a shorthand version of the css. Firefox and Chrome will, but it will break in IE. What we would intuitively write as

$('element').animate({ padding: '10px 20px' })

Should Become

$('element').animate({ paddingTop:'10px', paddingBottom:'10px', paddingLeft:'20px' paddingRight:'20px' })

Hopefully this will help someone else out.