LoginSignup
6
8

More than 5 years have passed since last update.

slickで自作の移動するボタンを作るときのメモ

Last updated at Posted at 2015-09-09

便利なslickで自作の移動するボタンを作ろうと
ググったら以下のようなのが引っかかる

$(".slideshow").slick({
    dots: true
});
$(".menu a").click(function(e){
    e.preventDefault();
    slideIndex = $(this).index();
    $(".slideshow").slickGoTo(parseInt(slideIndex));
});

しかし動かない・・・

もしかしてバージョンが新しくない?

新しいとこうなる

var slick = $(".slideshow").slick({
    dots: true
});
$(".menu a").click(function(e){
    e.preventDefault();
    slideIndex = $(this).index();
    slick.slick('slickGoTo', parseInt(slideIndex));
});
6
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
8