动画完整对话框 [英] Animation Complete Dialog

查看:78
本文介绍了动画完整对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了UI对话框的问题。我迷上了完整的事件来创建一个TinyMCE,因为它与动画效果不佳。但它似乎没有在最新版本的JQuery UI中运行。



我搜索了发行说明,看看是否已更改或除了我没有看它在任何地方列出。



这是删除/移动的功能还是v1.10.0中的问题?



这是示例代码,在下面的jsfiddle中使用:

  $(div)。dialog({
show:{
效果:puff,
持续时间:400,
完成:function()
{
$(。complete)。html(动画完成。 );
}
}
});

以前的版本功能(1.9.2):



http://jsfiddle.net/N4APL/1/



最新版本功能(1.10.0):



http://jsfiddle.net/jXDYz/1/



注意:我使用MS CDN作为UI javascript,因为jsfiddle还没有。

解决方案

这是一段相当艰难的旅程,但我终于找到了你的问题和解决方案。



事实上,这个完整的功能已从jQuery UI对话框1.10.0中删除。 它不在API中。我不确定为什么它被删除了,它们肯定没有在升级指南中记录。



在深入研究1.10.0代码后,我发现这个:

  this._show(this.uiDialog,this.options.show); 

正如你所看到的,没有回调 ._ show (这只是jQuery的 .show )并且无法设置回调。确认!你被困住了。



...或者你将是jQuery 1.10.1而不是在路上:

  this._show(this.uiDialog,this.options.show,function(){
that._focusTabbable();
that._trigger(focus );
});

您仍然无法直接设置回调,但您可以通过<$ c $设置回调c> 1.10.1中的焦点选项。 我已确认此方法有效



<我仍然认为这对其他人来说会有点不稳定,但至少不适合你。您可以选择立即升级到jQuery 1.10.1,也可以直接使用1.9等待它。


I have encountered a issue with the UI dialog. I hooked into the complete event to create a TinyMCE since it does not play nice with the animations. But it does not seem to be working in the latest version of JQuery UI.

I searched around the release notes to see if this has been changed or anything but I did not see it listed anywhere.

Is this a removed/moved functionality or is this an issue in v1.10.0?

Here is the sample code, used in the jsfiddle below:

$("div").dialog({
    show:{
        effect:"puff",
        duration:400,
        complete:function()
        {
            $(".complete").html("Animation Complete.");
        }
    }
});

Previous Version Functionality(1.9.2):

http://jsfiddle.net/N4APL/1/

Latest Version Functionality(1.10.0):

http://jsfiddle.net/jXDYz/1/

Note: I used the MS CDN for the UI javascript since jsfiddle does not have it yet.

解决方案

It was quite a journey, but I finally figured out your problem and solution.

Indeed this complete feature has been removed from jQuery UI dialog 1.10.0. It's not in the API. I'm not sure why it was removed, and they certainly don't have it documented in the upgrade guide.

After some digging into the 1.10.0 code, I found this:

this._show( this.uiDialog, this.options.show );

As you can see, there is no callback to ._show (which is just jQuery's .show) and no way to set a callback either. Ack! You're stuck.

...or you would be were jQuery 1.10.1 not on the way:

this._show( this.uiDialog, this.options.show, function() {
    that._focusTabbable();
    that._trigger("focus");
});

You still can't set a callback directly, but you can set it via the focus option in 1.10.1. I have confirmed that this works.

I still think this will be quite a bit shaky for others, but at least not for you. You have the option of either upgrading to jQuery 1.10.1 now or just waiting it out with 1.9 until it comes.

这篇关于动画完整对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆