Created
March 4, 2013 04:34
-
-
Save elyseholladay/5079974 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
😱