1
A
回答
1
<iframe id="miiframe" src="http://www.apple.com"></iframe>
<!-- example -->
<div id="loading" style="position:fixed;background:red;width:100%;height:100%;top:0;left:0;z-index:2;"></div>
<img id="background" style="position:absolute;width:100%;height:100%;top:0;left:0;z-index:-1;"/>
<script>
var loaded = false;
console.log(loaded);
function preloader(){
document.getElementById("loading").style.display = "none";
document.getElementById("miiframe").style.display = "block";
loaded = true;
console.log(loaded);
}//preloader
var loadiframe = document.getElementById('miiframe');
loadiframe.onload = preloader;
if(!loaded){
window.onload = function(){
background = document.getElementById("background");
background.src ="http://www.hdwallpapers.in/walls/cute_baby_in_autumn-wide.jpg";
};
}
</script>
0
嘗試
// hold `ready` event
$.holdReady(true);
var frame = $("<iframe>");
$(frame).load(function(e) {
// release `ready` event
$.holdReady(false)
});
// append `frame` to document
$("body").append(frame);
$(document).ready(function() {
// do stuff
// after `frame` loaded
$("body").append("done")
});
相關問題
- 1. 插入iFrame,然後在FF上的所有其他內容之前加載它。
- 2. 在WordPress的其他頁面內容之前加載div
- 3. 在其他內容之前使用Javascript添加內容
- 4. 加載內容之前
- 5. 在iframe之前加載javascript
- 6. 在出現iframe內容之前加載它
- 7. 在從服務器加載iframe的內容之前加載gif動畫
- 8. 在顯示HTML5之前加載內容
- 9. iframe內容加載之前用css與Firefox
- 10. 在遊戲內容加載之前加載flash預加載器
- 11. iframe加載函數之前
- 12. jQuery - 確保內容在其淡入之前加載?
- 13. UIWebView中的iFrame在容器內加載iframe的內容UIWebView
- 14. HTTPS加載其他網站內容
- 15. index.php?s =不會加載其他內容
- 16. 加載iframe中的內容
- 17. iframe的內容加載
- 18. Web內容未加載iframe
- 19. 預加載的iFrame內容
- 20. 加載新內容之前淡出
- 21. 如何加載GitHub之前的內容?
- 22. 加載ajax內容之前的事件
- 23. 圖像加載之前內容?
- 24. 如何在加載其他所有內容後加載圖像?
- 25. 爲其他域的iframe創建內容
- 26. 在jquery中加載內容成功加載之前
- 27. 在加載內容之前加載UI元素Android
- 28. 如何在Shadowbox中加載內容之前防止iframe白色閃爍?
- 29. 從iframe加載內聯內容
- 30. 僅在其源內容已完全加載後才顯示iFrame
iframe的內容來自哪裏? – Alex 2014-10-06 14:33:13
它來自子域。主域名是一個WordPress站點,它從一個子域名上的網站中抽取一個表格 – user2753924 2014-10-06 14:37:26
你可以嘗試在jsfiddle上發佈一些內容嗎? – Alex 2014-10-06 14:39:42