Skip to main content

Bug Tracker

Side navigation

#10462 closed bug (notabug)

Opened October 09, 2011 08:53PM UTC

Closed January 26, 2013 09:55PM UTC

animate with stop calls in succession react synchronously to asynchronous actions

Reported by: timmywil Owned by: fracmak2
Priority: low Milestone: 1.next
Component: effects Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
Description

http://jsfiddle.net/4WhBL/10/

calling .stop().fadeIn().stop().fadeOut().stop().fadeIn() does not lead to a fadeIn

Attachments (0)
Change History (6)

Changed October 09, 2011 08:53PM UTC by timmywil comment:1

component: unfiledeffects
milestone: None1.next
priority: undecidedlow
status: newopen

Changed October 15, 2012 08:39PM UTC by dmethvin comment:2

owner: → fracmak2
status: openassigned

Changed October 15, 2012 09:34PM UTC by dmethvin comment:3

#11987 is a duplicate of this ticket.

Changed October 15, 2012 09:41PM UTC by fracmak2 comment:4

_comment0: The underlying issue has to do with an isHidden() call within animate. When an element is set to display: block, and opacity: 0;, the isHidden() call returns false, so fadeIn() calls resolve immediately because they believe they are done. \ \ I've boiled down the test to a new jsfiddle that more accurately represents the issue. \ \ http://jsfiddle.net/fracmak/4WhBL/24/ \ \ By calling stop(true), the state of the element is set into a partially visible state according to the animate function because display is set to block, but opacity never gets changed off of 0.1350337333060622

The underlying issue has to do with an isHidden() call within animate. When an element is set to display: block, and opacity: 0;, the isHidden() call returns false, so fadeIn() calls resolve immediately because it believes it is done.

I've boiled down the test to a new jsfiddle that more accurately represents the issue.

http://jsfiddle.net/fracmak/4WhBL/24/

By calling stop(true), the state of the element is set into a partially visible state according to the animate function because display is set to block, but opacity never gets changed off of 0.

Changed October 15, 2012 09:47PM UTC by fracmak2 comment:5

On a side note, fadeTo probably shouldn't be mixed with fadeIn/fadeOut because the fadeTo(1000, 0).fadeIn(1000) doesn't work

http://jsfiddle.net/fracmak/4WhBL/25/

Changed January 26, 2013 09:55PM UTC by dmethvin comment:6

resolution: → notabug
status: assignedclosed

This just seems a result of fade{In,Out} monkeying with the display property as part of their action and not using goToEnd. So although it's unfortunate I don't think it's wrong. If someone wants to propose a solution, great.