Skip to content

Instantly share code, notes, and snippets.

@sutter
Created July 25, 2013 08:32
Show Gist options
  • Save sutter/6077882 to your computer and use it in GitHub Desktop.
Save sutter/6077882 to your computer and use it in GitHub Desktop.
Set to same height
function setToSameHeight(elementBase, element){
$(window).load(function() {
elementBaseHeight = $(elementBase).height();
element = $(element);
$(element).css('height', elementBaseHeight);
});
$(window).resize(function() {
elementBaseHeight = $(elementBase).height();
element = $(element);
$(element).css('height', 'auto');
$(element).css('height', elementBaseHeight);
});
}
setToSameHeight( $('.portfolio .col-8 a'), $('.portfolio .col-8 .inner'));
setToSameHeight( $('.portfolio .col-4 a'), $('.portfolio .col-4 .inner'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment