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)
Change History (7)
Changed 13 years ago by
comment:1 Changed 13 years ago by
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
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
Working example of break at http://jsfiddle.net/K4FtG/ Break still present in 1.4.4rc2.
comment:4 Changed 13 years ago by
Keywords: | FadeIn added |
---|---|
Milestone: | 1.4.3 → 1.5 |
Priority: | → low |
Status: | new → open |
comment:6 Changed 12 years ago by
Milestone: | → 1.next |
---|---|
Resolution: | → fixed |
Status: | open → closed |
This is why we now have .stop(true, true). http://jsfiddle.net/timmywil/K4FtG/4/
fadeIn test case