Skip to main content

Bug Tracker

Side navigation

#11676 closed bug (invalid)

Opened May 01, 2012 05:32AM UTC

Closed September 23, 2012 08:59AM UTC

Last modified January 24, 2013 10:12PM UTC

Animate jumps to end if starting position is negative percentage in Safari

Reported by: spiralian_universe@yahoo.com Owned by: spiralian_universe@yahoo.com
Priority: undecided Milestone: None
Component: effects Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

This only happens in Safari.

If I set the margin of the animated element to negative percentage and call an animate on that object later, the element jumps to the end position.

$('#a').css('margin-left', '-3.1231230%');

$('#a').animate({"margin-left": "-100%"}, 1000)

Looks like when reading the property, inside the FX, it is messed up by the the fix under the line

// A tribute to the "awesome hack by Dean Edwards"

Attachments (0)
Change History (8)

Changed May 01, 2012 06:06PM UTC by sindresorhus comment:1

owner: → spiralian_universe@yahoo.com
status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

Changed May 16, 2012 08:35AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed August 11, 2012 04:06PM UTC by anonymous comment:3

+1

jquery 1.7.2 & 1.8.0 - not fixed

list.find('li:eq(' + newI + ')').css({'margin-left':'-100%'}, 1000).animate({'margin-left':'0%'}, 1500});

safari have bug

Changed September 09, 2012 04:17AM UTC by mikesherov comment:4

resolution: invalid
status: closedreopened

Changed September 09, 2012 04:19AM UTC by mikesherov comment:5

component: unfiledeffects
status: reopenedpending

I'm unable to reproduce, which version of safari are you using? http://jsfiddle.net/kUtj7/1/

Changed September 23, 2012 08:59AM UTC by trac-o-bot comment:6

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed November 15, 2012 07:52PM UTC by weigel@email0.de comment:7

This bug with negative percentage margins still exists:

Safari 5.1.7 Windows.

Can reproduce this bug with http://jsfiddle.net/kUtj7/1/ from above.

It works in every browser except Safari on Windows.

Changed January 24, 2013 10:12PM UTC by anonymous comment:8

To avoid this issue, use CSS Transitions for modern browsers and jQuery animate for the rest. Use modernizr to find out if the browser supports transitions.

if( !Modernizr.csstransitions ){

$('#gallery .slides').animate({"margin-left":'-200%'}, 750);

} else {

$('#gallery .slides').css({"margin-left":'-200%'});

}