Post by nmac » Wed Apr 20, 2016 6:58 pm

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.

Newbie

Posts

Joined
Tue Dec 22, 2015 12:49 am

Post by ostechnologies » Thu Apr 21, 2016 2:41 pm

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'});
}
}
);

Opencart Expert | sales[at]ost.agency
Skype - manish.osuniverse | Gtalk - manishmt

Extensions for Opencart @ https://www.ost.agency/product/product- ... extensions
ost.agency - ecommerce website design, development and digital company


User avatar
Active Member

Posts

Joined
Mon Apr 06, 2015 1:30 pm

Post by nmac » Thu Apr 21, 2016 9:45 pm

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

Newbie

Posts

Joined
Tue Dec 22, 2015 12:49 am
Who is online

Users browsing this forum: No registered users and 2 guests