Skip to content

Window Resize set heigth new? #45

@Messa1

Description

@Messa1

Is it possible to set the targetheight new after resize of the window?
I try this.

  // All images need to be loaded for this plugin to work so
    // we end up waiting for the whole window to load in this example
    $(window).load(function () {
        $(document).ready(function(){

        collage();


        });
    });     

    var size = "150"

    // Here we apply the actual CollagePlus plugin

    function checkWidth() {
            var windowSize = $(window).width();

            if (windowSize < 480) {
                var size = "120";
            }
            else if (windowSize < 720) {
                var size = "120";
            }
            else if (windowSize < 1160 ) {
                var size = "120";
            }
            else {
                var size = "150";
            }
            console.log(size);
        };

        // Execute on load
        checkWidth();
        // Bind event listener
        $(window).resize(checkWidth);   

        $(window).resize(collage);   


    function collage() {
        $('.Collage').removeWhitespace().collagePlus(
            {
                'fadeSpeed'     : 'fast',
                'targetHeight'  : size,
                'direction'     : 'vertical'
            }
        );
    };

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions