Ticket #998 (closed bug: invalid)
Nested .click()'s cascades unwanted animations
|Reported by:||dohpaz||Owned by:|
|Keywords:||fadeIn fadeOut fx animation queue||Cc:|
I do not know if this problem affects anything other than fadeIn/fadeOut, as these two methods are the ones I was working with when I discovered this problem. It seems that if I have a .click() on one DOM Element inside of another .click() on another DOM Element, using fadeIn/fadeOut more than twice will cause the previous calls to run in succession with every new click.
I have taken the liberty of creating as simple a proof of concept as I could, seeing as I just started using jQuery recently. It can be found at http://dohpaz.mine.nu/jquery/queue.php. It demonstrates both the broken state, and the fixed state, and very briefly shows how to fix the problem.
To replicate my problem, simply click on the 'Show Problem' link to pull up an overlay. Click anywhere on the overlay to remove it, and then repeat the process any number of times to see the problem "grow".
To "fix" the problem, click on the "Fix jQuery" link and repeat the above steps.
I am also attaching a patch that I am using that -- as far as I can tell -- fixes this problem. Please advise if there is a better, or more preferred, way to fix this. As a side note, this also seems to fix a problem with queuing up multiple animations before they are ran.