html - Modifiying Jquery to reset as browser window is to be re-size -


i have responsive layout similar divs , applying jquery divs match height of 1 more content. however, if browser window re-size divs remain same heigh when page loaded making text go out of div. there way somehow continue running jquery everytime user resize browser window?

to more descriptive of i'm trying acomplish have divs behave (on browser window rezise)as normal div text content , attributes width: #%; height: auto; difference divs match height of 1 bigger height.

here link of have: http://as.sjsu.edu/cf/vaishak/equalizetest/index.html

here jquery have max height:

<script> jquery(function(){ var maxheight = 0; $(".box").each(function(){    if ($(this).height() > maxheight) { maxheight = $(this).height(); } }); $(".box").height(maxheight); }); </script> 

here updated version still doesn't work when window resize.

$(document).ready(function(){     $(window).resize(function(event) {         resizediv();     });     $(document).ready(function(){         resizediv();     });     function resizediv(){         var maxheight = 0;         $(".box").each(function(){            if ($(this).height() > maxheight) { maxheight = $(this).height(); }         });         $(".box").height(maxheight);     }     }); 

any appreciated!

you forget using javascript , use pure css:

http://cssdeck.com/labs/ygq5x6k3

<div class="container">     <div>first</div>     <div>second</div> </div>  .container {     display: table; /* optional */     width: 100%; /* optional */ }  .container div {     display: table-cell; } 

its flexible , works many "columns" need. since pure css, can disable mobile devices via media queries.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -