Bug Tracker

Modify

Ticket #10462 (closed bug: notabug)

Opened 20 months ago

Last modified 4 months ago

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:
Blocking: Blocked by:

Description

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

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

Change History

comment:1 Changed 20 months ago by timmywil

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to effects
  • Milestone changed from None to 1.next

comment:2 Changed 7 months ago by dmethvin

  • Owner set to fracmak2
  • Status changed from open to assigned

comment:3 Changed 7 months ago by dmethvin

#11987 is a duplicate of this ticket.

comment:4 Changed 7 months ago by fracmak2

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.

Last edited 7 months ago by fracmak2 (previous) (diff)

comment:5 Changed 7 months ago by fracmak2

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/

comment:6 Changed 4 months ago by dmethvin

  • Status changed from assigned to closed
  • Resolution set to notabug

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.