Adjust column height

function adjustHeight() { var colCenter = $("#main").height(); var colLeft = $(".left-sidebar").height(); var colRight = $(".right-sidebar").height(); // Find the bigger number var newHeight = Math.max(colLeft, colCenter, colRight); $("#main").css("min-height",newHeight+"px"); $(".left-sidebar").css("min-height",newHeight+"px"); $(".right-sidebar").css("min-height",newHeight+"px"); }; // Call when page is ready $(function() { adjustHeight(); }); // Call when everything is loaded (including images) $(window).load(function() { adjustHeight(); }); // Call on browser resize $(window).resize(function(){ adjustHeight(); });

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.