Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get div height after div content load

Tags:

jquery

height

I am trying to set the height of one div equal to another. I will call them left and right divs. The right div content is not always the same and is loaded with jQuery. It is a filter so each time you click a filter, the content change and also the parent div height.

This is my code:

jQuery(document).ready(function($) {
    $(window).resize(function() {
        location.reload();
    });
    var Height = $("#archive").outerHeight();
    $('.recursos-sidebar').css("height", Height);
});

The problem is that the left div height is equal to right div when it is empty (no content is loaded).

Somebody know how can I get the height of the right div after the content change each time?

like image 653
ThemesCreator Avatar asked Dec 03 '13 18:12

ThemesCreator


1 Answers

You can get it from element clientHeight :

document.getElementById("test").clientHeight
like image 114
h.bahadorzadeh Avatar answered Sep 16 '22 12:09

h.bahadorzadeh