Как я могу сделать следующее модальное всплывающее окно автоматически через 5 секунд? Я не слишком хорошо знаком с jQuery или Javascript. Я знаю, что он, вероятно, имеет какое-то отношение к window.onload, но не совсем уверен, как его реализовать. Благодарю.
<script>
$(document).ready(function() {
$('.tip').qtip({
content: {
text: $('#register'),
},
position: {
my: 'center',
at: 'center',
target: $(document.body)
},
style: {
classes: 'qtip-tipsy'
},
show: {
modal: {
on: true,
blur: true, // Enables ability to exit when clicking on gray background
escape: true // Enables exit by escape key
},
when: {
}
}
})
});
</script>
</head>
<body>
<div id="register">
test
</div>
<button class="tip">Register</button>
функция setTimeout():
$(document).ready(function() {
setTimeout(showPopup,5000); // call showPopup after 5 seconds
});
function showPopup()
{
$('.tip').qtip({
content: {
text: $('#register'),
},
position: {
my: 'center',
at: 'center',
target: $(document.body)
},
style: {
classes: 'qtip-tipsy'
},
show: {
modal: {
on: true,
blur: true, // Enables ability to exit when clicking on gray background
escape: true // Enables exit by escape key
},
when: {
}
}
})
}