如何延迟对话加载2-3秒
$("#dialog-model").dialog({
height: 250,
width: 350,
buttons: {
"Yes": function () {
window.location = "/MyURL";
},
"No": function () {
$(this).dialog('close');
}
},
modal: true
});
答案 0 :(得分:2)
使用setTimeout
var seconds=3000;
setTimeout(
function(){
$("#dialog-model").dialog({
height: 250,
width: 350,
buttons: {
"Yes": function () {
window.location = "/MyURL";
},
"No": function () {
$(this).dialog('close');
}
},
modal: true
});
},seconds);