【发布时间】:2018-09-30 14:56:58
【问题描述】:
我在 jquery 中使用 .load() 时遇到问题
这是我当前的代码
jQuery(document).on('click','#Pagination a', function(e){
e.preventDefault();
var link = jQuery(this).attr('href');
var nxtPage = jQuery(this).attr('href');
window.history.pushState('obj', 'newtitle', nxtPage);
jQuery('.preloadswitch').load(link+' .the-categories').fadeIn('slow');
});
这确实有效,但是我需要它在获取内容时淡入 + 预加载器,然后在内容可见时消失
我可以把它做成一个具有“beforeSend”或“success”功能的ajax吗?谢谢
这也不行
jQuery('.preloadswitch').load(link+'.the-categories',function(response,status,xhr){
if(status == 'sucess'){
jQuery('.preloadswitch').removeClass('addpreloader');
}
});
【问题讨论】:
标签: javascript jquery wordpress pagination