Answer the question
In order to leave comments, you need to log in
How can I make the following code execute every time the browser window is resized?
$(document).ready(function() {
var maxtop = 0,
$topperblock = $('.topper-block');
$topperblock.each(function(){
if($(this).height() > maxtop){
maxtop = $(this).height();
}
});
$topperblock.each(function(){
$(this).height(maxtop);
});
});
Answer the question
In order to leave comments, you need to log in
$(document).ready(function() {
var maxtop = 0;
var $topperblock = $('.topper-block');
$(window).resize(function(){
$topperblock.each(function(){
if($(this).height() > maxtop){
maxtop = $(this).height();
}
$(this).height(maxtop);
});
});
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question