April 29, 201214 yr Howdy, Is there anyway to reload your javascript on the fly as you are resizing your browser? I'm using some javascript to create equal height columns, the 3 columns equalling the height of the largest column <!-- Equal Footer Column jQuery script --> <script language="javascript" type="text/javascript" src="jquery.js"></script> <script> function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(".column")); }); </script> I'm using this so my shadow is centered between the columns. However, as I'm looking to make my design responsive, when you resize the window, you need the javascript to refresh otherwise you end up with this.....
April 29, 201214 yr function equalHeight(group) { tallest = 0; group.each(function() { thisHeight = $(this).height(); if(thisHeight > tallest) { tallest = thisHeight; } }); group.height(tallest); } $(document).ready(function() { equalHeight($(".column")); }); window.onresize = function(event) { equalHeight($(".column")); } That should do it. Not sure why you would want to though, the chances of someone re-sizing their browser while viewing your site are almost 0.
Create an account or sign in to comment