Skip to content

Instantly share code, notes, and snippets.

@almazka987
Created July 30, 2019 03:33
Show Gist options
  • Save almazka987/a91f60dea6fa2b933bb90eadf31b2e0d to your computer and use it in GitHub Desktop.
Save almazka987/a91f60dea6fa2b933bb90eadf31b2e0d to your computer and use it in GitHub Desktop.
Equal Height Columns

Equal Height Columns with responsive

Equal Height function applies if screen width more than 757px

scripts.js:

// Equal Height Columns
function setEqualHeight(columns) {
    var tallestcolumn = 0;
    columns.each(
        function() {
            currentHeight = $(this).height();
            if(currentHeight > tallestcolumn) {
                tallestcolumn = currentHeight;
            }
        }
    );
    columns.height(tallestcolumn);
}

if (window.screen.availWidth > 757) {
    setEqualHeight($(".three-columns .item"));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment