HaBo
HaBo

Reputation: 14297

jquery Delay dialog loading?

How can i delay Dialog loading for like 2-3 sec

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

Upvotes: 0

Views: 227

Answers (1)

Ben
Ben

Reputation: 1302

Use 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);

Upvotes: 2

Related Questions