How to make 2 Div Same Height On IE and FF , Javascript

I’ve got a Scenario. Where if  a div changed on height , the other has to follow the same height.

Now on Mozzilla the Resize will not work. because there isn’t any Property/Event for this, I've tried Watch Property but does not run.

although DOMAttrModified will be called when an attribute changed, but that’s what i need.

on IE :

//IE

$('#Element1').bind("resize", function() {
$('#Element2').height($(this).height());
});

//FireFox

if($.browser.mozilla) {
$("#Element1").bind("DOMAttrModified", element1Changed);
}

function element1Changed()
{
$('#Element2').height($("#Element1").height());
}
Share this post: | | | |
Published Monday, April 19, 2010 4:12 PM by cipto

Comments

No Comments