我想知道如何计算对话框弹出之前需要多长时间?例如,当您访问某个网站时,我想将其设置为 30 秒后弹出窗口显示。这可能吗?
<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>
最佳答案
关于javascript - 计时 jQuery UI 对话框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11351100/