【发布时间】:2017-09-23 00:59:11
【问题描述】:
我使用 iframe 每 5 秒加载一次 iframe 中的内容。它工作正常。发生的情况是,每次加载时它都会一直闪烁,这有点烦人。
我想将 iframe 代码转换为滚动 div,以便 iframe src 内容每 5 秒加载一次,并且闪烁应该消失。
这是我的代码:
我的主页 (INDEX.HTML) 有:
<iframe src="messages.php#bottom" width="674" height="476" frameborder="0" name="main" allowtransparency="yes" scrolling="auto"/></iframe>
Messages.php的内容是这样的
<html>
<head>
<script>
window.onload = function() { setTimeout("window.location.href='messages.php';", 5000) }; // 5000 = 2 seconds (it's in milliseconds)
</script>
</head>
<body>
<?php Application.logs ?>
</body>
</html>
我正在尝试使用这个文件:
https://gist.github.com/aklump/5470863 - 但我不知道该怎么做
【问题讨论】:
标签: javascript php jquery html iframe