admin管理员组文章数量:1406926
On changing the select option i am displaying the image and on success of ajax call hiding that image .. but this happens very fast .. i want to display the image for some time say 2 seconds. how to do it
my code
var div_id = $(this).closest('tr').find('.display_image').attr("id");
$("#"+div_id).empty().html('<img src="${resource(dir:'images',file:'spinner.gif')}"/>');
$("#"+div_id).show();
$.ajax({
type: "POST",
url:"${createLink(controller:'s2PublicLifecycle',action:'UpdateField')}",
data: dataString,
success: function() {
$("#"+div_id).hide();
}
});
On changing the select option i am displaying the image and on success of ajax call hiding that image .. but this happens very fast .. i want to display the image for some time say 2 seconds. how to do it
my code
var div_id = $(this).closest('tr').find('.display_image').attr("id");
$("#"+div_id).empty().html('<img src="${resource(dir:'images',file:'spinner.gif')}"/>');
$("#"+div_id).show();
$.ajax({
type: "POST",
url:"${createLink(controller:'s2PublicLifecycle',action:'UpdateField')}",
data: dataString,
success: function() {
$("#"+div_id).hide();
}
});
Share
Improve this question
asked Jul 25, 2012 at 9:52
maazmaaz
3,66422 gold badges65 silver badges106 bronze badges
2 Answers
Reset to default 5use jquery delay:
$("#"+div_id).delay(2000).hide(1);
Here's a jsfiddle
try setTimeout(function() { $("#"+div_id).hide(); }, 2000 );
本文标签: javascriptJquery Show image for some timeStack Overflow
版权声明:本文标题:javascript - Jquery Show image for some time - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744985443a2636063.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论