Mon. - Fri. 9 am - 5 pm Ask a Question
Remember me

Amount of columns on different devices

5 years 9 months ago #1

  • Kristian's Avatar
  • Kristian
  • Posts: 3
Hey,

is there a way to set the amount of images in a row for large, medium, small and extra small devices (as in bootstrap)?

I would like to show 6 images on large and medium devices, 4 on small devices and 2 images in a row on smartphones.

Thanks,
Kris

5 years 9 months ago #2

  • Artem's Avatar
  • Artem
  • Posts: 9773
Hi Kris,

This option will be available at Gallery 2.0. For the moment I can propose you next.
Go to: components >> com_bagallery >> assets >> js >> ba-gallery.js

Line 104, there you will find next code:
function getWidthContent()
        {
            var n = galleryOptions.column_number * 1,
                s = galleryOptions.image_spacing * 1,
                w = $container.width() * 1;
            if (winSize < 1024 && winSize > 600 && n > 3) {
                n = 3;
            } else if (winSize <= 600 && winSize > 450 && n > 2) {
                n = 2;
            } else if (winSize <=450) {
                n = 1;
            } else {
                n = galleryOptions.column_number * 1;
            }
            return ((w - s *  n * 2) / n) + s;
        }

Play with it B)

Regards,

5 years 9 months ago #3

  • Kristian's Avatar
  • Kristian
  • Posts: 3
Perfect! Works now as i wanted it! Thank you very much!
Powered by Kunena Forum