Indeed, the activate
event is fired before the animation is complete, and this is by design. We will consider exposing one more event after the animation is complete, in case there is demand for it.
You can use the following approach in order to avoid hard-coding the timeout duration, when animation is enabled:
animation = e.sender.options.animation;
timeout = animation && animation.open.duration;
// animation is complete here
The above will work with disabled animation as well, although the setTimeout will not be required in that case.
Actually, when animation is disabled, the activate event is fired after the new tab container is already visible. Are you sure about the opposite? You can make the following test:
1. Go to http://demos.kendoui.com/web/tabstrip/events.html
"The new tab container is "
". Its height is "
+ parseInt($(e.contentElement).height(), 10));});
3. Click on an inactive tab.
Another possible approach (instead of using expand animation with setTimeout) is to use fade
animation without setTimeout:
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI