Created
July 24, 2012 06:10
-
-
Save riix/3168320 to your computer and use it in GitHub Desktop.
Document Resize Callback
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
jQuery(document).ready(function() { | |
// This will fire when document is ready: | |
jQuery(window).resize(function() { | |
// This will fire each time the window is resized: | |
if(jQuery(window).width() >= 800) { | |
// if larger or equal | |
var colHeight = Math.max( | |
jQuery('#main').height(), | |
jQuery('#left').height(), | |
jQuery('#right').height() | |
); | |
jQuery('#main, #left, #right').height(colHeight); | |
} else { | |
// if smaller | |
jQuery('#main, #left, #right').removeAttr( 'style' ); | |
} | |
}).resize(); // This will simulate a resize to trigger the initial run. | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment