javascript - Making the column height same and remove extra content -


i have question, webpage has many div section , have multiple ul li. 2 column design , need set same height both corresponding div section. example check image, 1 section , want set height shortest div , remove large div content. possible do?

i checked on internet getting set both column height unable find how can remove content.

the right image want.

please :)

enter image description here

assuming you're using jquery, try this:

var $targets = $('.awesomeclass'),     targetheight = $targets.first().height();  $targets.each(function() {     var $this = $(this);     if( $this.height() < targetheight ) {         targetheight = $this.height();     } });  $targets.height( targetheight ); 

this code set height of matching elements height of shortest member.

just make sure target elements have class awesomeclass, or whatever class decide use, , add overflow: hidden; overflowing elements cut off. method remain functional if decide change number of elements etc.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -