前端文档

slick的一些用法

日期:2017-12-29 阅读:546

官网: http://kenwheeler.github.io/slick

   $('.d12sliderwrap_dingzi').slick({
  infinite: true,
  slidesToShow: 1,
  slidesToScroll: 1,
  autoplay: true,
  speed: 600,
  responsive: [
{
  breakpoint: 979,
  settings: {
slidesToShow: 1,        
  }
},
 
  ]
  
});
var hashv = window.location.hash;
if(hashv=='#anchor1tad2')  $('.d12sliderwrap_dingzi').slick('slickGoTo', 1);
 
 
    $('.mobislider_dingzi span').click(function(){
 
  var indexv = $(this).index();
// alert(indexv);
   $('.d12sliderwrap_dingzi').slick('slickGoTo', indexv);
});
  -------------
css:
去掉线: .slick-slide, .slick-slide *{ outline: none !important; }
-------------
on的用法:
$('.sliderwrap').on('click','.slick-dots li',function(e){
  var trackcode = 'clickm' + ($(this).index()+1)
  if(displaymobi == 'block'){
    var type = 'Mobile';
    trackcode = 'MOB'+trackcode;
    
  }else{       
    var type = 'PC';
    trackcode = 'PC'+trackcode;
  }
  landing_trackhtml(trackcode,type);
})
 

 

 
 

<<点击返回