Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flexslider with centered current image

am trying to build a Flexslider carousel - which has multiple images but the current image is centered, with the next/prev images to either side going off-screen - like this site http://www.ncad.ie/

So far I've got it with a single image: http://jsfiddle.net/Y3kx5/

Lookign around other issues this one claims to solve it but I can't get it to work: FlexSlider: Center current image

have tried other flexslider JS such as:

$('.flexslider').flexslider({
animation: "slide",
controlNav: false,
itemWidth: 800,
minItems: 3,
maxItems: 3
});

but that 3 images on screen - whereas I want only the current one to be fully onscreen with the next/prev displaying only as much as the window allows.

Thanks in advance .ben.

like image 919
topiman Avatar asked Aug 20 '13 16:08

topiman


1 Answers

Actually have just solved it :-)

Here's the final piece: http://jsfiddle.net/Y3kx5/2/

Done with the CSS:

.container {overflow: hidden; width: 100%}
.flexslider {max-width: 800px; width: 800px; margin: 0 auto}
.content {background: #f2f2f2; max-width: 800px; display: block; margin: 0 auto}
.flex-viewport {overflow: visible !important}
like image 181
topiman Avatar answered Nov 03 '22 21:11

topiman