Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

slick slider multiple sliders on one page

$('.slider-for').each(function(key, item) {

  var sliderIdName = 'slider' + key;
  var sliderNavIdName = 'sliderNav' + key;

  this.id = sliderIdName;
  $('.slider-nav')[key].id = sliderNavIdName;

  var sliderId = '#' + sliderIdName;
  var sliderNavId = '#' + sliderNavIdName;

  $(sliderId).slick({
    slidesToShow: 1,
    slidesToScroll: 1,
    arrows: false,
    fade: true,
    asNavFor: sliderNavId
  });

  $(sliderNavId).slick({
    slidesToShow: 4,
    slidesToScroll: 1,
    asNavFor: sliderId,
    dots: true,
    arrows: true,
    centerMode: false,
    focusOnSelect: true
  });

});
Comment

Multiple Slick Sliders On Same Page with same classes

$(document).ready(function() {
    var myCarousel = $(".slider-for:not(.slick-initialized)");
    myCarousel.each(function() {
        $(this).slick({});
    });
});
Comment

Multiple Slick Sliders On Same Page with same classes

$(function () {
    $('.slider-for').each(function(num, elem) {
        elem = $(elem);
        elem.slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            arrows: false,
            draggable: false,
            fade: true,
            asNavFor: '.slider-nav'
        });

        elem.next('.slider-nav-thumbnails').slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            asNavFor: '.slider-for',
            dots: false,
            arrows: false,
            vertical: true,
            draggable: false,
            centerMode: false,
            focusOnSelect: true,
            responsive: [
                {
                    breakpoint: 769,
                    settings: {
                        vertical: false
                    }
                }
            ]
        });
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: object keys javascript 
Javascript :: js get parameters 
Javascript :: react copy to clipboard button 
Javascript :: jquery ajax 500 error handling 
Javascript :: javascript to get uri 
Javascript :: Sending an Ajax request before form submit 
Javascript :: ant design table sort string perfectly 
Javascript :: js how to remove # from any url using js 
Javascript :: mat checkbox change event in angular 7 
Javascript :: removeclass multiple 
Javascript :: create module in js 
Javascript :: javascript print random word from lsit 
Javascript :: How to check if array includes a value from another array in JavaScript 
Javascript :: remove array elements javascript 
Javascript :: javascript check typeof array 
Javascript :: function(a, b){return b - a} 
Javascript :: generate random number between two numbers javascript 
Javascript :: part of sting js 
Javascript :: moment get weekday name 
Javascript :: for loop on a array 
Javascript :: node js server get images from folder 
Javascript :: jquery if .val is blank 
Javascript :: anonymous function jquery 
Javascript :: react-native android build apk 
Javascript :: how to remove identical string in javascript 
Javascript :: npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! functions@ lint: `tslint --project tsconfig.json` 
Javascript :: laravel jquery csrf 
Javascript :: sotre json on chrome storage 
Javascript :: javascript use variable regex 
Javascript :: access variable outside for loop javascript 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =