jquery延迟对话框加载?

时间:2011-12-15 18:29:46

标签: delayed-job jquery-dialog

如何延迟对话加载2-3秒

 $("#dialog-model").dialog({
    height: 250,
    width: 350,
    buttons: {
        "Yes": function () {
            window.location = "/MyURL";
        },
        "No": function () {
            $(this).dialog('close');
        }
    },
    modal: true
});

1 个答案:

答案 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);
相关问题