CsharpBeginner CsharpBeginner - 1 month ago 5
HTML Question

Resize a group of divs in Jquery

I need to resize this group of divs. How can I accomplish this?

function resizePanelsToBiggest(){
//termPanel
var maxheight = 0;

var terms = $('.termPanel');

for(var i = 0;i<terms.length;++i){

terms[i].height = 500;
}
}

Answer

You are setting the CSS based on an element that has a class so you could set it in the CSS file or style section or do this.

$('.termPanel').height(500);

The class selector grabs all of the element with that class and you set the stlye. No for loop needed.