-1

We have a jquery where we do drag and drop effect based on using different images. The drag and drop works fine and we can even exchange information among the images. The issue now just before we allow the drag and drop to complete we call a pop-up window like this window.open(url, "VALUES", "width=500,height=300");. In it we have 2 text boxes and javascript to validate the data entry. The issue is that in the main window we must not proceed (drag n drop) until the pop-up window text boxes have been filled and information sent back to main window? How to control that ?

4

2 回答 2

2

您可以使用此处描述的技术检测窗口是否已关闭:

function checker () {
    if (windowRef.closed)
        allowDrops = true;
    else
        setTimeout(checker, 100);
}

所以你要做的是当你打开窗口时,设置allowDrops为 false 并调用checker(). 修改您的拖放事件处理程序,使其仅在 allowDrops 为 时才有效true

于 2012-07-26T17:25:27.743 回答
1

使用var returnValue = window.showModalDialog(...);而不是window.open().

模态窗口是一个阻塞调用,在模态窗口关闭之前,主页中的 javascript 将不会继续。

https://developer.mozilla.org/en/DOM/window.showModalDialog

于 2012-07-26T17:28:23.653 回答