【问题标题】:How can I create class transition effects in Kendo UI?如何在 Kendo UI 中创建类转换效果?
【发布时间】:2012-09-09 09:08:03
【问题描述】:

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

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

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

【问题讨论】:

    标签: 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-11-27
      • 2015-10-17
      • 1970-01-01
      • 2016-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多