Skip to content

Instantly share code, notes, and snippets.

@elyseholladay
Created March 4, 2013 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elyseholladay/5079974 to your computer and use it in GitHub Desktop.
Save elyseholladay/5079974 to your computer and use it in GitHub Desktop.
// detect page width, if it's more than 700px, apply .equalheight to .product_attributes
var $win = $(window);
console.log($(window).width());
var $widthDiv = $(".product_attributes");
function checkWindowSize(){
console.log($(window).width());
if ($(window).width() >= 700) {
// $widthDiv.addClass('equalheight');
// set FAQ product attributes to equal heights
var attributeheight = 0;
$('.attribute').each(function(){
attributeheight = Math.max(attributeheight, $(this).height());}
).height(attributeheight);
}
// else
// $widthDiv.removeClass('equalheight');
}
$win.resize(function() {
checkWindowSize();
});
checkWindowSize();
@elyseholladay
Copy link
Author

😱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment