getting height of the dynamically loaded div

Posted by user1223654 on Stack Overflow See other posts from Stack Overflow or by user1223654
Published on 2012-09-15T08:54:02Z Indexed on 2012/09/15 9:38 UTC
Read the original article Hit count: 108

Filed under:
|

i am facing some difficulty with getting the height of the dynamically loaded div image.. sometimes , it gives the correct height but sometimes it gives zero .. here is my code

$.ajax({
                        type: "POST",
                        url: "images.php",
                        data: dataStr,
                        cache: false,
                        async : false,
                        success: function(data)
                        {

                        $('.up').empty();
                        $(".up").html(data);
                        alert($(".loadimg").height());

                          }
                         });

here is what i am appending

echo '<div class="imagediv">
    <img src="default.jpg"  class="loadimg" />
        </div>  ';

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about AJAX