How can i add space between owl item. add margin or padding between items. this is need to be responsive.can i add some gutter in to the jquery.
I found the solution. But I had to change source code.
I added new option "padding" into $.fn.owlCarousel.options{}
. Then I changed formula in calculateWidth : function () {}
calculateWidth : function () {
var base = this;
base.itemWidth = Math.round( (base.$elem.width() + base.options.padding) / base.options.items);
console.log(base.$owlItems.width());
},
And last thing, I added this padding (padding-right) for items:
appendItemsSizes : function () {
var base = this,
roundPages = 0,
lastItem = base.itemsAmount - base.options.items;
base.$owlItems.each(function (index) {
var $this = $(this);
$this
.css({
"width": base.itemWidth,
"padding-right": base.options.padding
})
.data("owl-item", Number(index));
if (index % base.options.items === 0 || index === lastItem) {
if (!(index > lastItem)) {
roundPages += 1;
}
}
$this.data("owl-roundPages", roundPages);
});
},
So now I can just initialize carousel with option "padding" like this:
$(".carousel").owlCarousel({
items : 3,
padding : 23
});
And get this result: