Javascript 在我的Wordpress ajax导航上预加载图像?
我有带ajax导航的WordPress。单击左侧链接时,将加载Javascript 在我的Wordpress ajax导航上预加载图像?,javascript,jquery,html,ajax,Javascript,Jquery,Html,Ajax,我有带ajax导航的WordPress。单击左侧链接时,将加载中的html。我想做的是预加载出现在上述div中的图像 这是我的密码 jQuery.post(ajaxurl, data, function(html) { jQuery('.page-details').html('<div class="row">' + html + '</div>'); }).done(function(data) { jQuery('.hb-loader').hide(
中的html。我想做的是预加载出现在上述div中的图像
这是我的密码
jQuery.post(ajaxurl, data, function(html) {
jQuery('.page-details').html('<div class="row">' + html + '</div>');
}).done(function(data) {
jQuery('.hb-loader').hide();
});
jQuery.post(ajaxurl、数据、函数(html){
jQuery('.page details').html(''+html+'');
}).完成(功能(数据){
jQuery('.hb loader').hide();
});
在此之前,我应该添加什么代码来预加载图像:
jQuery('.hb loader').hide()代码>有一些插件可以预加载图像。您可以在github中搜索这些。
例如:
我尝试过一些插件,但由于ajax导航,它没有帮助,每当我点击右边的链接时,它都会延迟加载图像并向下推送文本。这个黑点是我的.hb加载程序,我需要在图像预加载后黑点消失。
https://github.com/hacke2/preLoad