我正在使用
打开一个jquery popUp div $("#saveDialogSingleFeature").dialog();
我只希望div出现3秒然后自动关闭
尝试使用$("#saveDialogSingleFeature").dialog('close')}, 3000);
但这没有做任何事情......它不应该关闭吗?
$(function () {
$("#saveDialogSingleFeature").dialog();
$("#saveDialogSingleFeature").dialog('close')}, 3000);
});
答案 0 :(得分:0)
$(function () {
$("#saveDialogSingleFeature").dialog();
setTimeout(function(){
$("#saveDialogSingleFeature").dialog('close')
}, 3000);
});
答案 1 :(得分:0)
$(document).on('popupafteropen', '.ui-popup', function() {
setTimeout(function () {
$(this).popup('close');
}, 3000);
});
Plz让我知道这对你有用吗</ p>
答案 2 :(得分:0)
您可以使用setTimeout
$("#saveDialogSingleFeature").dialog({
open: function() {
var a = $(this);
setTimeout(function() {
a.dialog('close');
}, 3000);
}
});