我需要在 iframe 加载时显示加载 GIF。
这就是我想出的:
<div id="m-load" style="position:relative;top:45%;left:45%;">
<img src="images/loader.gif"/></div>
<iframe src="http://myserver.com/myfile.html" id="m-iframe"></iframe>
在我输入的 iframe 源文件中:(myfile.html)
<head>
<script>
top.document.getElementById('m-load').style.display ="none";
</script>
</head>
但这在 Firefox 中不起作用(权限被拒绝)。
还有其他方法可以实现吗?