Skip to content

Instantly share code, notes, and snippets.

@jrthib
Created June 29, 2013 00:31
Show Gist options
  • Save jrthib/5889118 to your computer and use it in GitHub Desktop.
Save jrthib/5889118 to your computer and use it in GitHub Desktop.
Stop execution of code on browser width
$(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