37 lines
970 B
JavaScript
37 lines
970 B
JavaScript
(function($) {
|
|
$(function() {
|
|
|
|
var jcarousel = $('.jcarousel');
|
|
|
|
jcarousel
|
|
.on('jcarousel:reload jcarousel:create', function () {
|
|
var carousel = $(this),
|
|
width = carousel.innerWidth();
|
|
|
|
if (width >= 600) {
|
|
width = width / 4;
|
|
} else if (width >= 350) {
|
|
width = width / 2;
|
|
}
|
|
|
|
carousel.jcarousel('items').css('width', Math.ceil(width) + 'px');
|
|
})
|
|
.jcarousel({
|
|
wrap: 'circular'
|
|
})
|
|
|
|
.jcarouselAutoscroll({
|
|
interval: 3000,
|
|
target: '+=1',
|
|
autostart: true
|
|
})
|
|
|
|
$('.jcarousel-control-prev').jcarouselControl({
|
|
target: '-=1'
|
|
});
|
|
|
|
$('.jcarousel-control-next').jcarouselControl({
|
|
target: '+=1'
|
|
});
|
|
});
|
|
})(jQuery); |