Search and Top Navigation
#4924 closed bug (worksforme)
Opened October 25, 2009 01:06PM UTC
Closed November 13, 2009 02:52PM UTC
Last modified October 11, 2012 09:15PM UTC
Broken toggleClass(...) method
Reported by: | sshark | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | ui.effects.core | Version: | 1.7.2 |
Keywords: | toggleClass duration | Cc: | |
Blocked by: | Blocking: |
Description
Hi,
I found that if I clicked "Run Effect" in http://jqueryui.com/demos/toggleClass/ before the animation is completed, the box wouldn't animate again.
I am using FF 3.5.3 (Mac SL) and IE8.
Thanks
Attachments (0)
Change History (3)
Changed November 06, 2009 02:26PM UTC by comment:1
Changed November 13, 2009 02:52PM UTC by comment:2
resolution: | → worksforme |
---|---|
status: | new → closed |
You could accomplish what you want by calling .stop(true, true) before calling .toggleClass(). I'm not inclined to change the demo.
Changed October 11, 2012 09:15PM UTC by comment:3
milestone: | TBD |
---|
Milestone TBD deleted
This happens because the class animations grab the current style settings before the animation begins so that it can restore them after the animation completes (since it needs to modify those settings to do the animation). By running a second class animation during an existing class animation, the second one restores the style settings at the time that the second animation began. This will contain settings for all of the properties that will be animated during subsequent animations. This would require the clear inline styles option from #3928 to make this work, and even then it wouldn't be exactly what the user expects.