Created
June 29, 2013 00:31
-
-
Save jrthib/5889118 to your computer and use it in GitHub Desktop.
Stop execution of code on browser width
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
$(window).resize(function() { | |
var w = $(window).width(); | |
if(w > 1024) { | |
fixDivsHeight(); | |
} else { | |
// do whatever mobile wants here... | |
} | |
}); | |
function fixDivsHeight() { | |
/* STORE EQUAL HEIGHT DIVS */ | |
$('.singleshop').each(function(){ | |
var highestBox = 0; | |
$(this).find('.box').each(function(){ | |
if($(this).height() > highestBox){ | |
highestBox = $(this).height(); | |
} | |
}); | |
$(this).find('.box').height(highestBox); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment