Bug Tracker

Opened 13 years ago

Closed 12 years ago

#6496 closed bug (fixed)

.fadeIn() breaks when using .dequeue() rapidly

Reported by: rasamassen Owned by:
Priority: low Milestone: 1.next
Component: effects Version: 1.4.2
Keywords: FadeIn Cc:
Blocked by: Blocking:

Description

Because .fadeIn() ultimately doesn't mess with opacity, if you rapidly use the following, eventually the element's opacity is set to near zero by fadeIn()/fadeOut():

$('.foobar').hover(function() {

$('.sub').dequeue().stop(); $('.sub').delay(600).fadeTo('400',1);

}, function() {

$('.sub').dequeue().stop(); $('.sub').delay(600).fadeOut('400');

});

From what I understand in the documentation, fadeIn should bring an element to opacity:1. fadeTo can take to variable opacity in between.

Attached is an example that shows fadeIn failing to reach opacity:1 where fadeTo succeeds.

Attachments (1)

test.html (2.1 KB) - added by rasamassen 13 years ago.
fadeIn test case

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by rasamassen

Attachment: test.html added

fadeIn test case

comment:1 Changed 13 years ago by rasamassen

I double checked the definition of fadeIn: Display the matched elements by fading them to opaque. Thus, if opacity of an element called by fadeIn is set, it's opacity should be changed to 1 by the completion of fadeIn. This is not happening.

comment:2 Changed 13 years ago by rasamassen

What may be a simple solution to this is to make fadeIn/fadeOut call fadeTo rather than directly calling animate. fadeTo has been developed to account for many more possibilities.

comment:3 Changed 13 years ago by rasamassen

Working example of break at http://jsfiddle.net/K4FtG/ Break still present in 1.4.4rc2.

comment:4 Changed 13 years ago by SlexAxton

Keywords: FadeIn added
Milestone: 1.4.31.5
Priority: low
Status: newopen

comment:5 Changed 13 years ago by rasamassen

Still broken in 1.5

comment:6 Changed 12 years ago by Timmy Willison

Milestone: 1.next
Resolution: fixed
Status: openclosed

This is why we now have .stop(true, true). http://jsfiddle.net/timmywil/K4FtG/4/

Note: See TracTickets for help on using tickets.