简体   繁体   English

如何使用预定义函数关闭 JQuery 对话框?

[英]How can I close a JQuery dialog using a pre-defined function?

I want to make my dialog close after the following function:我想在以下功能后关闭我的对话框:

function decide(category, choice, price, bool) {
  data.push([category, choice, price, earn]);
}

I have tried playing around with JQuery's close method .我尝试使用 JQuery 的close 方法 I set it as a "characteristic" of the dialog as the guide describes.正如指南所描述的那样,我将其设置为对话框的“特征”。 Does anybody know how I can set the dialog to close after the above function has been triggered?有人知道如何在触发上述功能后关闭对话框吗?

Would really appreciate any feedback or advice you could give me!!!非常感谢您能给我的任何反馈或建议!!! :) :)

Consider the following.考虑以下。

function decide(category, choice, price, bool) {
  data.push([category, choice, price, earn]);
  $(selector).dialog("close");
}

You simply need to call the close method.您只需要调用close方法。 $(selector) will need to be changed to represent the proper element that Dialog was initialized upon. $(selector)将需要更改以表示 Dialog 被初始化的正确元素。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM