Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在我的Wordpress ajax导航上预加载图像?_Javascript_Jquery_Html_Ajax - Fatal编程技术网

Javascript 在我的Wordpress ajax导航上预加载图像?

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(

我有带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();
});
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