admin管理员组文章数量:1289603
i'm using Slick.js to make 2 caroussels connected, and they are syncronised. Slick offers the possibility, at the section "Slider Syncing" slick.js website
But when i'm using it, it doesnt work, i'm getting an error: Uncaught TypeError: Cannot read property 'getSlick' of undefined
my code is :
$('#page-gravure .sliders .slides-show ul').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: '.slides'
});
$('#page-gravure .sliders .slides ul').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slides-show',
centerMode: true,
focusOnSelect: true
});
Please guys, can you help me ?
EDIT: JSFIDDLE Example
i'm using Slick.js to make 2 caroussels connected, and they are syncronised. Slick offers the possibility, at the section "Slider Syncing" slick.js website
But when i'm using it, it doesnt work, i'm getting an error: Uncaught TypeError: Cannot read property 'getSlick' of undefined
my code is :
$('#page-gravure .sliders .slides-show ul').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: '.slides'
});
$('#page-gravure .sliders .slides ul').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '.slides-show',
centerMode: true,
focusOnSelect: true
});
Please guys, can you help me ?
EDIT: JSFIDDLE Example
Share Improve this question edited Nov 30, 2015 at 12:50 Jean-Claude Pratt-Delzenne asked Nov 30, 2015 at 11:13 Jean-Claude Pratt-DelzenneJean-Claude Pratt-Delzenne 4511 gold badge3 silver badges12 bronze badges 5- Are you able to provide a minimum working example by using something like jsfiddle? =] – Relequestual Commented Nov 30, 2015 at 11:16
- there's one on their website kenwheeler.github.io/slick in the middle of the home page at the section "Slider Syncing" :) – Jean-Claude Pratt-Delzenne Commented Nov 30, 2015 at 11:21
- A minimum working example of YOUR code, which causes the problem. Because then you make validating a solution to the problem as easy as possible. – Relequestual Commented Nov 30, 2015 at 11:22
- hoo okey, i'll do that and add it. – Jean-Claude Pratt-Delzenne Commented Nov 30, 2015 at 11:24
- 1 the Jsfiddle is added to my question post. – Jean-Claude Pratt-Delzenne Commented Nov 30, 2015 at 12:51
1 Answer
Reset to default 6The problem is that both of your references for the synced slider asNavFor: ...
are wrong. The reference should be the same as you do to construct each slide. So your constructor functions should be as follows:
$('#page-gravure .sliders .slides-show ul').slick({
slidesToShow: 1,
slidesToScroll: 1,
arrows: false,
fade: true,
asNavFor: '#page-gravure .sliders .slides ul'
});
$('#page-gravure .sliders .slides ul').slick({
slidesToShow: 3,
slidesToScroll: 1,
asNavFor: '#page-gravure .sliders .slides-show ul',
centerMode: true,
focusOnSelect: true
});
Here's a working JSFiddle
Cheers
本文标签: javascriptCarousels slickjs39getSlick39 of undefinedStack Overflow
版权声明:本文标题:javascript - Carousels slick.js : 'getSlick' of undefined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741416171a2377524.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论