Search code examples
javascriptjquerygalleria

Update galleria width/height when browser is changing dimensions


I have a question. Can I update the size of this plugin when I change dimensions of my browser, or maybe I could just bind it's size to some container and then it would change the size by default? Maybe it is possible to scale it somehow because I really don't want to make my site "fixed" because of this.

                <script>
                Galleria.loadTheme('media/js/galleria/themes/classic/galleria.classic.min.js');
                $("#gallery").galleria(
                {
                    width: (this is what I want to be dynamic),
                    height: (this is what I want to be dynamic),
                    clicknext: true,
                    transition: 'fade',
                    showCounter: false
                });
                </script>

Solution

  • There is an undocumented method called rescale(), call this to update the gallery measurements anytime, f.ex when you change the size of the container.