javascript - 如何使用预定义函数关闭 JQuery 对话框?
问题描述
我想让我的对话框在以下功能后关闭:
function decide(category, choice, price, bool) {
data.push([category, choice, price, earn]);
}
我尝试过使用 JQuery 的close 方法。如指南所述,我将其设置为对话框的“特征”。有人知道在触发上述功能后如何将对话框设置为关闭吗?
非常感谢您能给我的任何反馈或建议!!!:)
解决方案
考虑以下。
function decide(category, choice, price, bool) {
data.push([category, choice, price, earn]);
$(selector).dialog("close");
}
您只需要调用该close
方法。$(selector)
将需要更改以表示初始化 Dialog 的正确元素。
推荐阅读
- audio - 改变wav文件的长度
- reactjs - React-Redux 表单提交
- javascript - 为什么使用 jQuery 在点击时每次添加 after() 文本两次?
- r - 将各种 .txt 和 .html 文件连接到 R 中的一个 .txt 文件
- python - 如何使用python查找列表中出现频率最高的元素
- class - 构建 Lua 类
- html - Flutter:从网站获取“原始” html 文档
- xml - 将 xml/xmi 格式的 SysML 模型导入图形数据库
- survival-analysis - 使用 cph 功能校准(使用外部验证)
- javascript - Laravel 在 If 中使用 div 值