您好我想知道是否有任何技術可以通過它來控制使用jquery的加載圖像可以長時間顯示的時間。例如:在jquery中顯示加載圖像很長時間
$('#ajax').html('<img src="ajax.gif"/>');
$('#iframe').load('file.php');
現在我想知道有什麼方法可以通過它顯示ajax.gif指定的時間?請告訴我。
您好我想知道是否有任何技術可以通過它來控制使用jquery的加載圖像可以長時間顯示的時間。例如:在jquery中顯示加載圖像很長時間
$('#ajax').html('<img src="ajax.gif"/>');
$('#iframe').load('file.php');
現在我想知道有什麼方法可以通過它顯示ajax.gif指定的時間?請告訴我。
嘗試
var loader = '<img id="loader" src="http://tools.patentcalls.com/images/spinner.gif"/>';
jQuery(document).ready(function() {
setTimeout(function() {
jQuery('#ajax').html(loader);
}, 1000);
jQuery('#iframe').load('file.php');
});
閱讀'setTimeOut':https://developer.mozilla.org/en/DOM/window.setTimeout – diEcho 2011-05-24 05:50:49