Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var vslider = tns({
- container: '.card-slider__items-slider',
- slideBy: 1,
- mode: 'gallery',
- axis: 'horizontal',
- autoplay: false,
- mouseDrag: true,
- center: true,
- autoWidth: false,
- loop: false,
- rewind: true,
- preventActionWhenRunning: false,
- nav: true,
- lazyload: true,
- swipeAngle: 50,
- navPosition: 'bottom',
- controlsContainer: '.card-slider-nav',
- controlsText: shop2_gr.settings.sliderControls,
- responsive: {
- 320: {
- controls: false,
- nav: true
- },
- 768: {
- controls: true,
- nav: true,
- }
- }
- });
- var small_slider = tns({
- container: '.card-slider__thumbs-slider',
- loop: false,
- gutter: 10,
- center:false,
- mouseDrag: true,
- nav: false,
- disable: false,
- controls: false,
- navPosition: 'bottom',
- preventActionWhenRunning: false,
- axis: 'horizontal',
- responsive: {
- 320: {
- items: 3
- },
- 640: {
- items: 3
- },
- 768: {
- items: 3,
- disable: stickyFlag
- },
- 1024: {
- items: 4
- },
- 1261: {
- items: 4
- },
- 1340: {
- items: 4
- }
- }
- });
- var navIndex = $('.card-slider__items .tns-nav-active').index();
- $('.card-slider__thumbs-slider .card-slider__thumb').removeClass('tns-nav-active');
- $('.card-slider__thumbs-slider .card-slider__thumb').eq(navIndex).addClass('tns-nav-active');
- vslider.events.on('indexChanged', function(){
- var navIndex = $('.card-slider__items .tns-nav-active').index();
- $('.card-slider__thumbs-slider .card-slider__thumb').removeClass('tns-nav-active');
- $('.card-slider__thumbs-slider .card-slider__thumb').eq(navIndex).addClass('tns-nav-active');
- /*if (vslider.getInfo().index>vslider.getInfo().indexCached) {
- //console.log('right')
- } else {
- //console.log('left')
- }*/
- });
- vslider.events.on('indexChanged', function(){
- small_slider.goTo(vslider.getInfo().index);
- });
- $(document).on('click', '.card-slider__thumbs-slider .card-slider__thumb', function(){
- var thisIndex = $(this).index();
- $('.card-slider__items .tns-nav button').eq(thisIndex).click();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement