【问题标题】:How can I create class transition effects in Kendo UI?如何在 Kendo UI 中创建类转换效果?
【发布时间】:2012-09-09 09:08:03
【问题描述】:
【问题讨论】:
标签:
javascript
jquery
jquery-ui
effects
kendo-ui
【解决方案1】:
在 kendo.fx.js 中有 kendoAddClass、kendoRemoveClass 和 kendoToggleClass,它们在可用时使用 CSS3 过渡,在不可用时回退到直接替换。它们还没有记录,因为动画是直接用 CSS 完成的,只能通过从元素中删除过渡来停止。
经过检查,jQuery 插件似乎在 2012 年第二季度(内部版本 710)中损坏了。我已经修复了它们,修复将在下周随服务包一起发布。同时,您仍然可以使用曾经为它们提供动力的 kendo.toggleClass() 方法。它的用法是这样的:
kendo.toggleClass(element, classes, options, toggle);
element: jQuery object
classes: one or more classes to apply (separated by a space)
options: {
exclusive: "all",
duration: 400,
easing: "ease-out"
} - options is optional, can be omitted, the values up there are default and fed to the transition CSS property, duration is in ms.
toggle: add/remove the class.
从下周的服务包开始,您可以像这样直接使用它:
$("#test").kendoAddClass(classes, options);
哦,忘了加jsBin demo