每 5 秒刷新一次 Fancybox
Refresh Fancybox Every 5 seconds
我有一个加载到 iframe 中的 fancybox。
<script type="text/javascript">
$(document).ready(function () {
$("#prodacom_aerohivebundle_aerohivessid_ssid_inschakelen").fancybox({
type: "iframe",
href: "http://localhost/aerohive_ap/web/app_dev.php/queue"
});
});
</script>
这工作正常,但现在我想在不关闭 iframe/fancybox 的情况下每 5 秒刷新一次 iframe。
这可能吗?
谢谢!
根据 SO
上的相关回答
$.fancybox.update(); // update
setInterval(function () {
$.fancybox.update();
}, 5000); // calls update every 5 seconds
您可以使用:-
setInterval(function () {
document.querySelector('.fancybox-wrap iframe').contentWindow.location.reload();
},5000);
我有一个加载到 iframe 中的 fancybox。
<script type="text/javascript">
$(document).ready(function () {
$("#prodacom_aerohivebundle_aerohivessid_ssid_inschakelen").fancybox({
type: "iframe",
href: "http://localhost/aerohive_ap/web/app_dev.php/queue"
});
});
</script>
这工作正常,但现在我想在不关闭 iframe/fancybox 的情况下每 5 秒刷新一次 iframe。
这可能吗?
谢谢!
根据 SO
上的相关回答$.fancybox.update(); // update
setInterval(function () {
$.fancybox.update();
}, 5000); // calls update every 5 seconds
您可以使用:-
setInterval(function () {
document.querySelector('.fancybox-wrap iframe').contentWindow.location.reload();
},5000);