开发者

Displaying loading image for a long time in jquery

开发者 https://www.devze.com 2023-03-08 09:21 出处:网络
Hi I want to know is there any technique through which I can control the time for which the loading image usi开发者_开发知识库ng jquery can be displayed for a long time. For example:

Hi I want to know is there any technique through which I can control the time for which the loading image usi开发者_开发知识库ng jquery can be displayed for a long time. For example:

$('#ajax').html('<img src="ajax.gif"/>');
$('#iframe').load('file.php');

Now I want to know is there any way through which I can display the ajax.gif for a specified amount of time? Please let me know.


try

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');
});
0

精彩评论

暂无评论...
验证码 换一张
取 消