window.showmodaldialog备用,以便它阻止函数执行 [英] window.showmodaldialog alternate so that it blocks function execution

查看:93
本文介绍了window.showmodaldialog备用,以便它阻止函数执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有类似这样的javascript函数

I have a javascript function some thing like this

function func(){
............
............
var v=window.showModelDialog(url);
............// returned value in v is used here
}


在此函数中,该函数的执行在modelDialog行处被阻止,并且在对话框关闭后,我使用返回的值.

问题是我必须使用jquery插件进行模型对话框.

我尝试了一些内置插件,例如facebox,fancybox或colorbox.

使用这些插件永远不会在那里调用停止执行,并且在执行了整个函数之后,将弹出窗口打开,并且变量"v"始终是未定义的.执行永远不会在
停止


In this function the execution of the function is blocked at modelDialog line and after the dialog is closed I use the returned value.

The problem is that I have to use a jquery plugin for model dialog.

I have tried some built-in plugin like facebox, fancybox or colorbox.

Using these plug-ins the execution is never stopped at there call and after the whole function is executed the pop-up is opened and the variable ''v'' is always undefined.The execution is never stopped at

var v=$.fn.colorbox(href: 'url');

................//v is undefined here as colorbox is not opened in the above line, it is opened after function has ended execution.


我想要的是阻止执行,直到关闭弹出窗口,或者有任何想法或者知道类似的内置jquery插件?

我已经尝试过一个解决方案,在colorbox的onClosed事件上调用一个函数并复制过去该函数中所有剩余的代码,它可以正常工作,但是我想要另一个解决方案,因为我必须用jquery替换整个应用程序中的showModelDialog插件,这对我来说很难在代码中创建太多更改和太多新功能.我只想更改一行代码.


What I want is to block the execution until the pop-up is closed, have some one any idea or have knowledge of a similar built-in plugin of jquery?

I have tried already a solution that on the onClosed event of the colorbox call a function and copy past all the remaining code in that function and it works fine but I want another solution because I have to replace the showModelDialog from the whole application with a jquery plugin and it would be a tough time for me to create too much changes in the code and too much new functions. I want just one line code changes.

推荐答案

.fn.colorbox(href:' url'); ....... // v在这里未定义,因为colorbox不是在上一行中打开,在函数结束执行后将打开.
.fn.colorbox(href: 'url'); ................//v is undefined here as colorbox is not opened in the above line, it is opened after function has ended execution.


我想要的是阻止执行,直到关闭弹出窗口,或者有任何想法或者知道类似的内置jquery插件?

我已经尝试过一个解决方案,在colorbox的onClosed事件上调用一个函数并复制该函数中所有剩余的代码,它可以正常工作,但是我想要另一个解决方案,因为我必须用jquery替换整个应用程序中的showModelDialog插件,这对我来说很难在代码中创建太多更改和太多新功能.我只希望更改一行代码.


What I want is to block the execution until the pop-up is closed, have some one any idea or have knowledge of a similar built-in plugin of jquery?

I have tried already a solution that on the onClosed event of the colorbox call a function and copy past all the remaining code in that function and it works fine but I want another solution because I have to replace the showModelDialog from the whole application with a jquery plugin and it would be a tough time for me to create too much changes in the code and too much new functions. I want just one line code changes.


您的意思是这些 [ ^ ]?


你好,谢谢.不,首先,我必须使用内置的jquery插件,以便我可以插入iFrame或将完整的页面加载到该页面中,而且还可以应用CSS.
Hi, thanx for the reply; No, first of all I have to use a built-in jquery plugin so that I can insert iFrame or can load complete page into that plus I would be able to apply css as well.


这篇关于window.showmodaldialog备用,以便它阻止函数执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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