Skip to main content

Bug Tracker

Side navigation

#7399 closed bug (invalid)

Opened November 04, 2010 10:17AM UTC

Closed November 07, 2010 07:52PM UTC

Last modified March 10, 2012 06:48AM UTC

Animate Padding to Zero

Reported by: kevin@ksylvest.com Owned by:
Priority: undecided Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

The '.animate()' for padding always starts from zero pixel padding. A full description can be found here:

http://stackoverflow.com/questions/4095475/jquery-animate-padding-to-zero

Attachments (0)
Change History (3)

Changed November 04, 2010 12:11PM UTC by jitter comment:1

This bug doesn't happen for IE and Opera. But it shows in FF and Chrome.

This isn't an animate() bug but has to do with css().

test case

(Recently saw this) similar/related report #5526. Sometimes there seem to be problems with short-hand properties.

Instead of the workaround on stackoverflow you could also include the marginpadding.js from Brandon Aarons jQuery-cssHooks. This also fixes the problem

Your test case with jQuery-cssHooks

Changed November 07, 2010 07:52PM UTC by snover comment:2

resolution: → invalid
status: newclosed

I have updated the .animate documentation to match the .css documentation which states that shorthand properties are not supported.

Changed November 08, 2010 12:06AM UTC by jitter comment:3

@snover

Thanks for updating the documentation. But the copy-paste from the css() looks rather unfortunate. Maybe you should replace

For example, if you want to retrieve the rendered margin, use: $(elem).css('marginTop') and $(elem).css('marginRight'), and so on.

with

For example, if you want to animate the margin property, use

$(elem).animate({
    'margin-top' : 10,
    'margin-right' : 10,
    'margin-bottom' : 10,
    'margin-left' : 10
}, 1000);