miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.68k stars 299 forks source link

can you turn off justified gallery for mobile? #281

Closed ckarpinski closed 6 years ago

ckarpinski commented 6 years ago

Is there a way to turn off the justified gallery for mobile? so instead of rows it would just become all the images stacked.

jefftucker1952 commented 6 years ago

There's nothing built into the script to accomplish that.

It's really beyond the scope of this github, but conceptually you need to do two things. First, execute the script only if the window is wider than, say, 650px (trying to detect the actual device type is usually a real mess - using just the viewport width is simpler, and more effective). For example:

if ($(window).width() > 650) {
     $("#basicExample").justifiedGallery();
}

Then use a CSS media query to supply your own CSS to style the thumbnails if the viewport width is less than 651px.

ckarpinski commented 6 years ago

Awesome, thank you so much for the guidance