Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/88.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
jQuery预加载程序不工作_Jquery_Html_Css - Fatal编程技术网

jQuery预加载程序不工作

jQuery预加载程序不工作,jquery,html,css,Jquery,Html,Css,嗨,我正在使用这个插件在显示之前预装所有内容。 但是我不知道为什么这不起作用 HTML 如果您只是在JS Fiddle中测试,那么问题是JS Fiddle添加了一个: $(window).load(function(){ 这反过来又破坏了你的代码 如果您只是使用: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UT

嗨,我正在使用这个插件在显示之前预装所有内容。

但是我不知道为什么这不起作用

HTML


如果您只是在JS Fiddle中测试,那么问题是JS Fiddle添加了一个:

$(window).load(function(){
这反过来又破坏了你的代码

如果您只是使用:

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo</title>

  <script type='text/javascript' src='http://code.jquery.com/jquery-1.8.3.js'></script>



  <link rel="stylesheet" type="text/css" href="/css/result-light.css">



      <script type='text/javascript' src="http://gayadesign.com/scripts/queryLoader2/js/lib/jquery.queryloader2.js"></script>


  <style type='text/css'>

  </style>



<script type='text/javascript'>
$(document).ready(function () {
    $("body").queryLoader2({
        barColor: "#cccccc",
        backgroundColor: "#ffffff",
        percentage: true,
        barHeight: 3,
        completeAnimation: "fade",
        minimumTime: 200
    });  
});


</script>


</head>
<body>
  <div class="preload">
    <img src="http://placehold.it/500/500" />
    <img src="http://placehold.it/300/500" />
    <img src="http://placehold.it/600/500" />
    <img src="http://placehold.it/400/500" />
</div>

</body>


</html>

-JSFIDLE演示
$(文档).ready(函数(){
$(“正文”).queryLoader2({
barColor:#中交,
背景颜色:“ffffff”,
百分比:正确,
酒吧高度:3,,
完成动画:“褪色”,
最短时间:200
});  
});

然后它就会工作。

如果您只在JS Fiddle中测试,那么问题是JS Fiddle添加了一个:

$(window).load(function(){
这反过来又破坏了你的代码

如果您只是使用:

<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title> - jsFiddle demo</title>

  <script type='text/javascript' src='http://code.jquery.com/jquery-1.8.3.js'></script>



  <link rel="stylesheet" type="text/css" href="/css/result-light.css">



      <script type='text/javascript' src="http://gayadesign.com/scripts/queryLoader2/js/lib/jquery.queryloader2.js"></script>


  <style type='text/css'>

  </style>



<script type='text/javascript'>
$(document).ready(function () {
    $("body").queryLoader2({
        barColor: "#cccccc",
        backgroundColor: "#ffffff",
        percentage: true,
        barHeight: 3,
        completeAnimation: "fade",
        minimumTime: 200
    });  
});


</script>


</head>
<body>
  <div class="preload">
    <img src="http://placehold.it/500/500" />
    <img src="http://placehold.it/300/500" />
    <img src="http://placehold.it/600/500" />
    <img src="http://placehold.it/400/500" />
</div>

</body>


</html>

-JSFIDLE演示
$(文档).ready(函数(){
$(“正文”).queryLoader2({
barColor:#中交,
背景颜色:“ffffff”,
百分比:正确,
酒吧高度:3,,
完成动画:“褪色”,
最短时间:200
});  
});

然后它就工作了。

这很奇怪。它不适合我,我只是从网站上复制了代码。也许这与JSFIDLE有关。你有没有在js Fiddle之外试用过?是的,它在简单页面中工作,但在我的wordpress网站上不工作,你知道是什么导致了这个问题吗?在我的wordpress网站中,加载程序停止在53%,然后什么也没有发生。@VikasGhodke在这种情况下,JS小提琴在显示你的问题时是不准确的。你需要链接到wordpress实例,我们才能帮助你:)这很奇怪。它不适合我,我只是从网站上复制了代码。也许这与JSFIDLE有关。你有没有在js Fiddle之外试用过?是的,它在简单页面中工作,但在我的wordpress网站上不工作,你知道是什么导致了这个问题吗?在我的wordpress网站中,加载程序停止在53%,然后什么也没有发生。@VikasGhodke在这种情况下,JS小提琴在显示你的问题时是不准确的。您需要链接到wordpress实例,以便我们能够提供帮助:)是的,它在简单页面中工作,但在我的wordpress网站上不工作,您知道问题的原因吗?在我的wordpress网站中,加载程序停止在53%,然后什么也没有发生。@VikasGhodke在这种情况下,JS小提琴在显示你的问题时是不准确的。你需要链接到wordpress实例,以便我们能够提供帮助:)是的,我会上传我的主题并让你知道。谢谢你的帮助,Ryan。是的,它在简单页面中工作,但在我的wordpress网站上不工作,你知道问题的原因吗?在我的wordpress网站中,加载程序停止在53%,然后什么也没有发生。@VikasGhodke在这种情况下,JS小提琴在显示你的问题时是不准确的。你需要链接到wordpress实例,以便我们能够提供帮助:)是的,我会上传我的主题并让你知道。谢谢你的帮助,瑞安。