我有这段代码依赖于Embedly API来用视频和缩略图替换链接:
$('a.oembed').each(function(){
$(this).embedly({maxWidth:525,'method':'replace'}).bind('embedly-oembed', function(e, oembed){
$(this).parent().append($("<img>", { src: oembed.thumbnail_url, width:200 })).children('img').wrap('<div class="thumbnail_border" />');
});
});
我要在发出此请求时显示加载图像,并在返回缩略图时将其隐藏。我该怎么做?
我也有隐藏隐藏缩略图并显示视频的代码:
$(".thumbnail_border img").live('click', function() {
$(this).toggle();
$(this).parent().hide();
$(this).parent().parent().children('.embed').toggle();
$(this).parent().parent().children("div.description_div").hide();
});
我想在用户单击时显示加载图像,并且在视频出现后将其隐藏。我也将如何做?
最佳答案
使用回调作为tfbox建议。使用以下效果:
$(“ urdiv”)。fadeIn('slow');和$(“ urdiv”)。fadeOut('slow')//有关详细信息,请参见jquery文档
一些信息here
关于javascript - 使用JQuery显示/隐藏计时以加载动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6172318/