0
我正在使用以下AJAX将一些帖子内容拉入灯箱。所有的作品都很棒,但速度有点慢。任何人都可以给我一些指针,添加一个加载器图标到下面的代码?AJAX加载图标
谢谢!
jQuery(document).ready(function ($) {
$(".getpostidlink").unbind('click');
$(".getpostidlink").mouseover(function (event) {
$(".getpostidlink").unbind('click');
var postlinkid = $(this).data("postid");
var data = {
action: 'getpostidhref_action',
security: getpostidhref.security,
postdata: postlinkid,
complete: function() {
$(".getpostidlink").unbind('click');
}
};
$.post(getpostidhref.ajaxurl, data, function (response) {
$(".getpostidlink").colorbox({
inline: true,
width: "90%",
maxWidth: 800,
open: false,
onClosed: function() {
window.location.reload();
}
})
$("div.dynamicloadcontent").replaceWith(response);
});
});
});
检查该链接http://stackoverflow.com/questions/14859437/how-to-manually-make-the-colorbox-loading-gif-appear ,http://stackoverflow.com/questions/5412263/colorbox-show-simulate-loading-animation-for-inline-content –