Page 1 of 1

Default Carousel issues customising

Posted: Wed Apr 20, 2016 6:58 pm
by nmac
Hi,

This forum has been really great to refer to while building my first opencart (v.2102) site.

I am now stuck on the carousel and searching isn't helping. Any guidance appreciated on:

1 - How to horizontally centre the images for the front page carousel, i've tried lots of things but nothing has worked, they are always left aligned
2 - How to make main slideshow a loop instead of left scrolling back to first slide (quickly passing all middle slides).

site is brownsfoodco.com

Thanks in advance.

Re: Default Carousel issues customising

Posted: Thu Apr 21, 2016 2:41 pm
by ostechnologies
You can take help from the following code and make changes accordingly.

(

function()
{
var width=$('.owl-item').css('width');
var widths=width.split('px');
var no_of_items=<?php echo $item;?>;
var width=Number(widths[0])/Number(no_of_items);
var dimension=<?php echo $width;?>;
if(Number(dimension)<Number(width))
{
var left_width=Number(width)-Number(dimension);
left_width=Number(left_width)/2;
left_width=parseInt(left_width);
//alert(left_width);
$('.owl-item').css({'padding-left':left_width+'px','padding-right':left_width+'px'});
}
}
);

Re: Default Carousel issues customising

Posted: Thu Apr 21, 2016 9:45 pm
by nmac
Hi,

Thanks for the response, but sorry, where does this go? I'm not very experienced with code, more make it up as I go along.

N