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.
function newsCarousel(){
$("#carousel").owlCarousel({
items : 4,
itemsCustom : false,
itemsDesktop : [1199,4],
itemsDesktopSmall : [980,2],
itemsTablet: [768,1],
itemsTabletSmall: false,
itemsMobile : [479,1],
singleItem : false,
itemsScaleUp : false,
mouseDrag : true,
//Basic Speeds
slideSpeed : 200,
paginationSpeed : 800,
rewindSpeed : 1000,
//Autoplay
autoPlay : true,
stopOnHover : false,
//Auto height
autoHeight : true,
});
}
I found the solution. But I had to change source code. I added new option "padding" into
$.fn.owlCarousel.options{}
. Then I changed formula incalculateWidth : function () {}
And last thing, I added this padding (padding-right) for items:
So now I can just initialize carousel with option "padding" like this:
And get this result:
You can use pure CSS using box-shadow as follow:
You must know that at this time there isn't any way to add a margin directly in the owl carousel may they can make an apdate in the future, so the solution is to make the spaces with Css properties
you can add the
padding
in css and also themargin
and the best way to get the specific space you can use the mathematic to calcul the space that you need and applied it to the padding and the marginI hope that this will help you to find the solution of your problem
you can follow this steps in this Tuto published by the official site of owl carousel plugin : http://www.istedod.uz/lib/owl-carousel/demos/custom.html
Maybe you are using OWL Carousel version 1, I suggest you use version 2.
You will get it here.
Go to Docs menu you will find everything.
Based on this demo I would say, just increase the margin in the .item class in custom.css.
Be careful with modifying CSS for responsive sites and plugins. If this needed to be adjusted for different resolutions, you could add to your custom.css some media queries and extend the styles accordingly
Config OwlCarousel: