dextermorgan
asked on
Make DIVs the same height
I have 2 divs - both with the same class that gives them a min-height. What i want to do is to use javascript/jquery to check the height of DIV B and change the min height in the class.
if there is a class 'divclass' which has the min-height property, then following code will change a property of a class.
setClassStyle( 0, "divclass", "min-height", document.getElementById("d ivB").heig ht);
setClassStyle( 0, "divclass", "min-height", document.getElementById("d
function setClassStyle(s_s,classname,class_style,style_valu e)
{
var style_sheet=document.styleSheets[s_s];
for (var j=style_sheet.rules.length-1;j>=0;j--)
{
var sS=style_sheet.rules[j];
var class_name=sS.selectorText.replace(/\./g,'');
if(class_name==classname)
{
sS.style[class_style]=style_value;
return 0;
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
divb, diva are id's of the div's
-Ajitha