I have a CSS3 treeview navigation which can be expandable and collapsable. I have this treeview in a div. When the tree is expanded/collapsed the div is expanded more than size of current window and I get scroll bars for that window. I want to get size of treeview div and set the height window to that size. I created onresize event for div tag, onresize function is called in IE but not in other browsers like firefox or IE. Is there any other way to get the function called or completely different way to auto resize height of DIV and its parents. Here is my code which I used.

function resize(obj){
if (obj != null) {
if(obj.offsetHeight > 700)