Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.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
Ruby on rails Firefox页面加载速度慢_Ruby On Rails_Jquery Plugins_Osx Lion_Loading_Nivo Slider - Fatal编程技术网

Ruby on rails Firefox页面加载速度慢

Ruby on rails Firefox页面加载速度慢,ruby-on-rails,jquery-plugins,osx-lion,loading,nivo-slider,Ruby On Rails,Jquery Plugins,Osx Lion,Loading,Nivo Slider,我在Lion上使用RubyonRails3.1开发了一个站点。我正在使用nivo滑块(内容旋转器)。在歌剧和狩猎中,我毫不迟延地完成了任务。但在Firefox中加载时可能需要10秒以上。在加载滑块之前,不会加载页面上的其他内容。另外,当我尝试使用true%>缓存资产时,我得到了错误数量的参数错误 _slider.html.erb <link rel="stylesheet" href="default.css" type="text/css" media="screen"/> <

我在Lion上使用RubyonRails3.1开发了一个站点。我正在使用nivo滑块(内容旋转器)。在歌剧和狩猎中,我毫不迟延地完成了任务。但在Firefox中加载时可能需要10秒以上。在加载滑块之前,不会加载页面上的其他内容。另外,当我尝试使用
true%>
缓存资产时,我得到了错误数量的参数错误

_slider.html.erb

<link rel="stylesheet" href="default.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="nivo-slider.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="style.css" type="text/css" media="screen"/>
<script type="text/javascript">
    jQuery(function() {
        jQuery("#nivoslider-283").nivoSlider({
            effect:"fade",
            slices:15,
            boxCols:8,
            boxRows:4,
            animSpeed:500,
            pauseTime:3000,
            startSlide:0,
            directionNav:false,
            directionNavHide:true,
            controlNav:false,
            keyboardNav:true,
            pauseOnHover:true,
            manualAdvance:false
        });
    });
</script>
<div id="wrapper">

  <a href="http://dev7studios.com" id="dev7link" title="Go to dev7studios">dev7studios</a>

  <div class="slider-wrapper theme-default">
    <div class="ribbon"></div>
    <div id="slider" class="nivoSlider">
      <img src="assets/3.jpg" alt="" title="This is an example of a caption"/>
      <img src="assets/1.jpg" alt="" data-transition="slideInLeft"/>
      <img src="assets/2.jpg" alt="" title="#htmlcaption"/>
    </div>
    <div id="htmlcaption" class="nivo-html-caption">
      <strong>This</strong> is an example of a <em>HTML</em> caption with <a href="#">a link</a>.
    </div>
  </div>

</div>
<script type="text/javascript" src="scripts/jquery-1.6.4.min.js"></script>
<script type="text/javascript" src="../jquery.nivo.slider.pack.js"></script>
<script type="text/javascript">
    $('#slider').nivoSlider();
</script>
application.html.erb

<!DOCTYPE html>
<html>
<head>
  <title>Cor</title>
  <%= stylesheet_link_tag 'application'%>
  <%= javascript_include_tag 'application' %>
  <%= csrf_meta_tags %>
</head>
<body>
<img src="assets/Lighthouse%201000w%20x%20300l%20pixels.jpg" id="header-image">
<%= render "shared/navigation" %>
<article>
  <%= yield %>
</article>
</body>
</html>

Cor

检查此工具的页面速度


您是否与YSlow一起查看了该页面?@llazzaro no,将给它一个提示shot@llazzaro谢谢,它给了我们很多建议。大部分我都不明白。但这只是一个开始。
.theme-default #slider {
    margin: 5px auto 0 auto;
    width:618px; /* Make sure your images are the same size */
    height:246px; /* Make sure your images are the same size */
}
.theme-pascal.slider-wrapper,
.theme-orman.slider-wrapper {
    margin-top:150px;
}

.clear {
    clear:both;
}

.nivoSlider
  {
    position:relative;
    width:  618px;
    height:  246px;
    background: url('loading.gif') no-repeat 50% 50%;
}
.nivoSlider img
  {
    position:absolute;
    top:0px;
    left:0px;
    display:none;
}
.nivoSlider a
  {
    border:0;
    display:block;
}
<!DOCTYPE html>
<html>
<head>
  <title>Cor</title>
  <%= stylesheet_link_tag 'application'%>
  <%= javascript_include_tag 'application' %>
  <%= csrf_meta_tags %>
</head>
<body>
<img src="assets/Lighthouse%201000w%20x%20300l%20pixels.jpg" id="header-image">
<%= render "shared/navigation" %>
<article>
  <%= yield %>
</article>
</body>
</html>