Skip to content

Instantly share code, notes, and snippets.

@quangpro1610
Last active July 21, 2020 02:49
<script type="text/javascript">
(function ($) {
$(function () {
$('.jcarousel').jcarousel();
$('.jcarousel-control-prev')
.on('jcarouselcontrol:active', function () {
$(this).removeClass('inactive');
})
.on('jcarouselcontrol:inactive', function () {
$(this).addClass('inactive');
})
.jcarouselControl({
target: '-=1'
});
$('.jcarousel-control-next')
.on('jcarouselcontrol:active', function () {
$(this).removeClass('inactive');
})
.on('jcarouselcontrol:inactive', function () {
$(this).addClass('inactive');
})
.jcarouselControl({
target: '+=1'
});
$('.jcarousel-pagination')
.on('jcarouselpagination:active', 'a', function () {
$(this).addClass('active');
})
.on('jcarouselpagination:inactive', 'a', function () {
$(this).removeClass('active');
})
.jcarouselPagination();
});
})(jQuery);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment