#5797 closed bug (worksforme)
callback to $('.ui-dialog).fadeOut() gets triggered twice
Reported by: | jf | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | ui.dialog | Version: | 1.8.2 |
Keywords: | dialog fadeout callback twice | Cc: | |
Blocked by: | Blocking: |
Description
This issue bugged me for a long time before I figured out that this was happening. To see clearly what's happening, try the following code once you have a dialog open:
$('.ui-dialog').fadeOut(1000, function() {
alert('fadeout callback');
});
You'll see that the callback gets called twice. Once immediately when the fadeout starts, and then the second time when the *real* callback ought to happen (ie., after the fadeout).
There is a workaround for this (but this is still a bug/surprise):
$('.ui-dialog').delay(1000, 'FF').queue('FF', function() {
alert('fadeout callback');
}).dequeue('FF');
Change History (4)
comment:1 follow-up: 2 Changed 12 years ago by
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 follow-up: 3 Changed 12 years ago by
Replying to scott.gonzalez:
This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.
"...and *one* is visible"
comment:3 Changed 12 years ago by
Replying to scott.gonzalez:
Replying to scott.gonzalez:
This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.
"...and *one* is visible"
wow, you're right!! thanks. I can't believe i didnt catch that... One question though - why does the workaround work in this case?
This is working properly. You probably have two dialogs on the page, one is already hidden and is visible.