光滑的滑块。将两个滑块同步到一个自定义附加点
Slick Slider. Sync two sliders to one custom append dots
我有两个同步的滑块,自定义附加点除外。理想情况下,我需要自定义点作为两个滑块的导航。目前,这些点仅适用于它附加到的滑块。
//*** Slick Stuff */
if ($(".masthead-content-slider").length > 0) {
$('.masthead-content-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
autoplay: true,
autoplaySpeed: 10000,
speed: 1000,
fade: true,
cssEase: 'ease',
draggable: false,
dots: true,
arrows: false,
asNavfor: '.masthead-image-slider',
appendDots: $('.slick-dots-masthead')
});
}
if ($(".masthead-image-slider").length > 0) {
$('.masthead-image-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
autoplay: true,
autoplaySpeed: 10000,
speed: 1000,
fade: true,
cssEase: 'ease',
draggable: false,
dots: false,
arrows: false,
asNavfor: '.masthead-content-slider'
});
}
$('.prev').click(function(){
$('.masthead-content-slider').slick('slickPrev');
$('.masthead-image-slider').slick('slickPrev');
});
$('.next').click(function(){
$('.masthead-content-slider').slick('slickNext');
$('.masthead-image-slider').slick('slickNext');
});
问题是由于拼写错误造成的。
asNavfor: '.masthead-content-slider'
应该是
asNavFor: '.masthead-content-slider'
我有两个同步的滑块,自定义附加点除外。理想情况下,我需要自定义点作为两个滑块的导航。目前,这些点仅适用于它附加到的滑块。
//*** Slick Stuff */
if ($(".masthead-content-slider").length > 0) {
$('.masthead-content-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
autoplay: true,
autoplaySpeed: 10000,
speed: 1000,
fade: true,
cssEase: 'ease',
draggable: false,
dots: true,
arrows: false,
asNavfor: '.masthead-image-slider',
appendDots: $('.slick-dots-masthead')
});
}
if ($(".masthead-image-slider").length > 0) {
$('.masthead-image-slider').slick({
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
autoplay: true,
autoplaySpeed: 10000,
speed: 1000,
fade: true,
cssEase: 'ease',
draggable: false,
dots: false,
arrows: false,
asNavfor: '.masthead-content-slider'
});
}
$('.prev').click(function(){
$('.masthead-content-slider').slick('slickPrev');
$('.masthead-image-slider').slick('slickPrev');
});
$('.next').click(function(){
$('.masthead-content-slider').slick('slickNext');
$('.masthead-image-slider').slick('slickNext');
});
问题是由于拼写错误造成的。
asNavfor: '.masthead-content-slider'
应该是
asNavFor: '.masthead-content-slider'