i am using a slick slider for my project. when I login to the application all the items come on the page along with the arrows. The carousel comes only after I refresh the page.
$(".best-sellers").not('.slick-initialized').slick({
dots: false,
infinite: false,
speed: 300,
slidesToShow: 5,
slidesToScroll: 5,
prevArrow: '<button type="button" class="btn-default slick-prev recentlyViewedControls"><i class="fa fa-2x fa-chevron-left" aria-hidden="true"></i></button>',
nextArrow: '<button type="button" class="btn-default slick-next recentlyViewedControls"><i class="fa fa-2x fa-chevron-right" aria-hidden="true"></i></button>'
});
}
The html part :
<div class="row recently-viewed-items" data-bind="foreach: cart.recentlyViewed()">
<div class="item col-sm-2 col-xs-6">
<a href="">
</a>
</div>
</div>
The foreach repeats the elements. The items come through ajax call.