How to disable the repetition of the images in the carousel in a gallery with few pictures
Opened this issue · 1 comments
lockerbleiben commented
Hey there,
I´m using the carousel gallery.
Some gallerys have few images but the width of the gallery is > 700px.
So the images get repeated. I want to ask, how to disable this.
lockerbleiben commented
"Schweigen im Walde" :(
I made little dirty workaround for this issue
<?
$number_of_images=0;
// this fills my array of images & increases $number_of_images
while([...])
{
// Fill an array of images, whatever
$number_of_images++;
}
/* reduce witdh of gallery if number of images is less than e.g. 6 */
// if $number_of_images ist smaller than 6, than fill style attribut max-width
// 160 is the estimated witdh of each image + margin/padding (adjust for your needs)
if($number_of_images<6) $max_width=' max-width:'.($i*160).'px;';
// surround div.gallery with a parent div, which gets the max-width if needed.
$out.='
<div style="margin:0 auto;'.$max_width.'">
<div id="gallery">'.$caroussel_images.'</div>
</div>';