Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Responsive Galleria

I'm trying to use this plugin Galleria in its responsive mode, which basically means it will re draw itself based on its container size as the window re-sizes. The demo on the link I've provided shows a really good example. You can see that, as you resize your window, the whole gallery adjusts accordingly. Now my issue is, the plugin won't let me initialize the gallery unless a height has been specified for the DOM element that is used as its container. This means, I've had to write a whole lot of javascript code to respond window resizes - it destroys the point of it having a responsive mode quite a bit - but in the website above, nowhere can I find an explicit height specified. Can someone explain to me where I'm going wrong?

like image 600
Jibi Abraham Avatar asked Jun 13 '12 09:06

Jibi Abraham


1 Answers

I figured it out by myself. Posting my answer -

When initializing the gallery - specify your height in percentages - as below. I'm guessing it takes 50% of window height as its value in this case. This way, you don't need to explicitly specify heights anywhere and it works as advertised

Galleria.run('#gallery', {responsive:true, height:0.5, debug:false});
like image 144
Jibi Abraham Avatar answered Sep 24 '22 13:09

Jibi Abraham