I am wondering how can I time how long it takes before the dialog pops up? For example, when you go to a site, i want to set it to 30 seconds before the pop up shows up. Is that possible?
<script type="text/javascript">
$(function(){
// Dialog
if ($.cookie('showDialog') == undefined || $.cookie('showDialog') == null || $.cookie('showDialog') != 'false') {
$('#dialog').dialog({
autoOpen: true,
width: 700,
modal: true,
buttons:{ "No Thanks": function() { $(this).dialog("close"); $.cookie('showDialog', 'false'); } },
});
}
// Dialog Link
$('#dialog_link').click(function(){
$('#dialog').dialog('open');
return false;
});
//hover states on the static widgets
$('#dialog_link, ul#icons li').hover(
function() { $(this).addClass('ui-state-hover'); },
function() { $(this).removeClass('ui-state-hover'); }
);
});
</script>
You can use
setTimeout().jsFiddle