gpt4 book ai didi

javascript - 如何在 Kendo UI 中创建类别过渡效果?

转载 作者:行者123 更新时间:2023-11-28 20:51:31 24 4
gpt4 key购买 nike

我工作的公司正在考虑用 Kendo UI 替换 jQuery UI。
我个人没有看到任何好处,而且我还发现 Kendo UI 的文档严重缺乏。

例如,在 jQuery UI 中,有这些漂亮的类过渡效果: http://jqueryui.com/docs/Effects/Methods#Class_Transitions

这些效果的 Kendo UI 等效项是什么?

最佳答案

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

关于javascript - 如何在 Kendo UI 中创建类别过渡效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12337855/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com