<bdo id='J2jUo'></bdo><ul id='J2jUo'></ul>

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

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

        光滑的滑块 - 同步自动播放和活动导航

        时间:2024-04-19
        • <bdo id='6Ewn4'></bdo><ul id='6Ewn4'></ul>

            <small id='6Ewn4'></small><noframes id='6Ewn4'>

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

            1. <legend id='6Ewn4'><style id='6Ewn4'><dir id='6Ewn4'><q id='6Ewn4'></q></dir></style></legend>
              <tfoot id='6Ewn4'></tfoot>

                  本文介绍了光滑的滑块 - 同步自动播放和活动导航的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用光滑的 Slider 创建一个滑块,允许用户选择该部分的标题并查看它的幻灯片,但也可以选择自动播放.

                  I am trying to use the slick Slider to create a slider that allows a user to select the title of the section and see the slide for it but also give the option for it to autoplay.

                  这些东西很好用.但是我需要一些方法来对应 make 它,以便当它自动播放时,它对应于活动导航并改变它的颜色.

                  The stuff works fine. But I need some way to correspond into make it so that when it autoplays, it corresponds to the active navigation and changes it color.

                  现在,如果用户单击它,它只会为活动幻灯片标题显示一种新颜色.我也希望它在自动播放时这样做

                  Right now it only show a new color for the active slide title if a user is clicking it. I want it to do so on autoplay also

                  我该怎么做??

                  这是我现在正在工作的代码

                  Here is the code I have working right now

                  Js Bin

                  我唯一改变的是光滑滑块演示中不存在的自动播放选项

                  The only thing I changed is that autoplay option that does not exist on the demo of slick slider

                   $('.slider-for').slick({
                   slidesToShow: 1,
                   slidesToScroll: 1,
                   arrows: false,
                   fade: true,
                   asNavFor: '.slider-nav',
                   autoplay:true
                  
                    });
                  $('.slider-nav').slick({
                  slidesToShow: 3,
                  slidesToScroll: 1,
                  asNavFor: '.slider-for',
                  dots: true,
                  centerMode: true,
                  focusOnSelect: true
                  });
                  

                  推荐答案

                  http://jsfiddle.net/bpbaz10L/

                  $('.slider-for').slick({
                      slidesToShow: 1,
                      slidesToScroll: 1,
                      arrows: false,
                      fade: true,        
                      autoplay:true,
                      //trigger after the slide appears
                      // i is current slide index
                      onAfterChange:function(slickSlider,i){
                           //remove all active class
                           $('.slider-nav .slick-slide').removeClass('slick-active');
                           //set active class for current slide
                           $('.slider-nav .slick-slide').eq(i).addClass('slick-active');         
                       }
                  
                  });
                  
                  
                  //set active class to first slide
                  $('.slider-nav .slick-slide').eq(0).addClass('slick-active');
                  

                  这篇关于光滑的滑块 - 同步自动播放和活动导航的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:使用 Bokeh Slider 滑动图像 下一篇:将 jquery 导航按钮放在滑块上

                  相关文章

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

                        <bdo id='ow6dv'></bdo><ul id='ow6dv'></ul>

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