<i id='ID38D'><tr id='ID38D'><dt id='ID38D'><q id='ID38D'><span id='ID38D'><b id='ID38D'><form id='ID38D'><ins id='ID38D'></ins><ul id='ID38D'></ul><sub id='ID38D'></sub></form><legend id='ID38D'></legend><bdo id='ID38D'><pre id='ID38D'><center id='ID38D'></center></pre></bdo></b><th id='ID38D'></th></span></q></dt></tr></i><div id='ID38D'><tfoot id='ID38D'></tfoot><dl id='ID38D'><fieldset id='ID38D'></fieldset></dl></div>

<small id='ID38D'></small><noframes id='ID38D'>

    • <bdo id='ID38D'></bdo><ul id='ID38D'></ul>
    <legend id='ID38D'><style id='ID38D'><dir id='ID38D'><q id='ID38D'></q></dir></style></legend>

      1. <tfoot id='ID38D'></tfoot>

      2. 我根本无法让我的 Slick 滑块工作

        I can#39;t get my Slick slider to work at all(我根本无法让我的 Slick 滑块工作)
        <legend id='5mdO1'><style id='5mdO1'><dir id='5mdO1'><q id='5mdO1'></q></dir></style></legend>
      3. <small id='5mdO1'></small><noframes id='5mdO1'>

              <tbody id='5mdO1'></tbody>

                <tfoot id='5mdO1'></tfoot>
                • <bdo id='5mdO1'></bdo><ul id='5mdO1'></ul>

                • <i id='5mdO1'><tr id='5mdO1'><dt id='5mdO1'><q id='5mdO1'><span id='5mdO1'><b id='5mdO1'><form id='5mdO1'><ins id='5mdO1'></ins><ul id='5mdO1'></ul><sub id='5mdO1'></sub></form><legend id='5mdO1'></legend><bdo id='5mdO1'><pre id='5mdO1'><center id='5mdO1'></center></pre></bdo></b><th id='5mdO1'></th></span></q></dt></tr></i><div id='5mdO1'><tfoot id='5mdO1'></tfoot><dl id='5mdO1'><fieldset id='5mdO1'></fieldset></dl></div>
                  本文介绍了我根本无法让我的 Slick 滑块工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试让一个褪色的、光滑的滑块在我的网站上工作.但我没有运气.这是 Slick:http://kenwheeler.github.io/slick/

                  I'm trying to get a fading, Slick slider to work on my website. But I'm having no luck. This is Slick: http://kenwheeler.github.io/slick/

                  如果您向下滚动,您将看到有关如何实施的说明.我附上了我的截图,希望有人能看到我做错了什么.

                  If you scroll down, you'll see the instructions on how to implement. I've attached my screenshot, so hopefully someone can see what I'm doing wrong.

                  <html>
                      <head>
                      <title>My Now Amazing Webpage</title>
                  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.3.11/slick.css"/>
                      </head>
                      <body>
                  
                      <div class="fade">
                     <div><img src="http://placehold.it/1000x400&text=[ img 1 ]" /></div>
                    <div><img src="http://placehold.it/1000x400&text=[ img 1 ]" /></div>
                    <div><img src="http://placehold.it/1000x400&text=[ img 1 ]" /></div>
                      </div>
                  
                      <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
                      <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
                  <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.3.11/slick.min.js"></script>
                  
                  
                      <script type="text/javascript">
                          $(document).ready(function(){       
                  $('.fade').slick({
                    dots: true,
                    infinite: true,
                    speed: 500,
                    fade: true,
                    slide: '> div',
                    cssEase: 'linear'
                  });
                      
                          });
                  </script>
                  
                      </body>
                  </html>

                  我是 Javascript 和 Jquery 的新手,所以我觉得我在那里搞砸了.

                  I'm new to Javascript and Jquery so I feel like I'm messing something up there.

                  当我加载我的页面时,我看到的只是 3 张测试图片,一张在另一张下方.

                  When I load my page, all I see are the 3 test images, one below the other.

                  有人知道我做错了什么吗?

                  Anyone know what I'm doing wrong?

                  推荐答案

                  问题出在slide设置(元素查询选择滑块)

                  The problem is in the slide setting (element query to select the slider)

                  例如改变:

                  $('.fade').slick({
                    dots: true,
                    infinite: true,
                    speed: 500,
                    fade: true,
                    slide: '> div',
                    cssEase: 'linear'
                  });
                  

                  $('.fade').slick({
                      dots: true,
                      infinite: true,
                      speed: 700,
                      autoplay:true,
                      autoplaySpeed: 2000,
                      arrows:false,
                      slidesToShow: 1,
                      slidesToScroll: 1
                   });
                  

                  工作,只是玩弄设置.您将 slide 定义为 >div(div 的中间子级),所以如果你删除它(默认为 div),它就可以工作.

                  Works, just play around with the settings. You were defining slide as > div (inmediate children of div), so if you remove it (defaults to div), it works.

                  <html>
                      <head>
                      <title>My Now Amazing Webpage</title>
                  <link rel="stylesheet" type="text/css" href="//cdn.jsdelivr.net/jquery.slick/1.3.11/slick.css"/>
                      </head>
                      <body>
                  
                      <div class="fade">
                     <div><img src="http://placehold.it/1000x400&text=[ img 1 ]" /></div>
                    <div><img src="http://placehold.it/1000x400&text=[ img 1 ]" /></div>
                    <div><img src="http://placehold.it/1000x400&text=[ img 1 ]" /></div>
                      </div>
                  
                      <script type="text/javascript" src="//code.jquery.com/jquery-1.11.0.min.js"></script>
                      <script type="text/javascript" src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
                  <script type="text/javascript" src="//cdn.jsdelivr.net/jquery.slick/1.3.11/slick.min.js"></script>
                  
                  
                      <script type="text/javascript">
                          $(document).ready(function(){       
                  $('.fade').slick({
                      dots: true,
                      infinite: true,
                      speed: 700,
                      autoplay:true,
                      autoplaySpeed: 2000,
                      arrows:false,
                      slidesToShow: 1,
                      slidesToScroll: 1
                   });
                      
                          });
                  </script>
                  
                      </body>
                  </html>

                  这篇关于我根本无法让我的 Slick 滑块工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                  CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                  Ordinals in words javascript(javascript中的序数)
                  getFullYear returns year before on first day of year(getFullYear 在一年的第一天返回前一年)
                  How do I make a TextGeometry multiline? How do I put it inside a square so it wraps like html text does inside a div?(如何制作 TextGeometry 多线?如何将它放在一个正方形内,以便它像 html 文本一样包裹在 div 内?) - IT屋-程序员软件开发技术分享社
                  How to use coffeescript in developing web-sites?(如何在开发网站时使用coffeescript?)
                  • <bdo id='AdxBI'></bdo><ul id='AdxBI'></ul>
                      <tbody id='AdxBI'></tbody>

                        <legend id='AdxBI'><style id='AdxBI'><dir id='AdxBI'><q id='AdxBI'></q></dir></style></legend>
                        • <i id='AdxBI'><tr id='AdxBI'><dt id='AdxBI'><q id='AdxBI'><span id='AdxBI'><b id='AdxBI'><form id='AdxBI'><ins id='AdxBI'></ins><ul id='AdxBI'></ul><sub id='AdxBI'></sub></form><legend id='AdxBI'></legend><bdo id='AdxBI'><pre id='AdxBI'><center id='AdxBI'></center></pre></bdo></b><th id='AdxBI'></th></span></q></dt></tr></i><div id='AdxBI'><tfoot id='AdxBI'></tfoot><dl id='AdxBI'><fieldset id='AdxBI'></fieldset></dl></div>
                            <tfoot id='AdxBI'></tfoot>

                            <small id='AdxBI'></small><noframes id='AdxBI'>