How to get element height after pasting content via AJAX?

I have a jQuery Mobile page in which I upload a form via AJAX. I set the page sizes using a plugin that calculates the sizes AFTER Ajax starts, and the layout has been updated (at least the following consoles appear later).

I need to get the height of the element that received the content, but no matter what I try, I just get garbage (~ 169px instead of 1200px)

Here is my code:

(inside plugin)
some: function(){

    var self = this,
    o = self.options,
    wrap = $('div:jqmData(wrapper="true").ui-page-active').last(),
    // elements
    panels = wrap.find('.ui-panel.ui-panel-active').filter(':not(.ui-popover)'),
    pages = panels.find('.ui-page'),
    contents = pages.find('.ui-content');

    // maxHeight contents
    for ( var i = 0; i < contents.length; i++){         
        ct = contents.eq(i);

        console.log( ct );
        console.log( ct.css("height") )
        console.log( ct.height() );
        console.log( ct.outerHeight() );    
    // max
    if ( ct.css("height") > parseFloat( o._iPadFixHeight ) ){
        o._iPadFixHeight = parseFloat( ct.css("height") ) + parseFloat( ct.css('padding-top')) +  parseFloat( ct.css('padding-bottom')) ;
        };
    }
     ...

If I do not use AJAX, this works correctly. If I dynamically add content through AJAX, all consoles start after AJAX, but still return only false values.

:
AJAX? - 10 Ajax, , . , 10 .

!

:
AJAX, , , AJAX. , :

$(window).on('dimensionchange', function(){             
    self.ome();
    })

$(window).trigger('dimensionchange')

AJAX. , , .

EDIT2:
, . @HolgerDSchauf . , AJAX false . :

Ajax:

...
// cleanup dimensions
$(window).trigger( 'dimensionclear');
...
window.setTimeout(function() {
   target.removeClass('.fade.in');
   // recalculate
   $(window).trigger('dimensionchange');    
   },250);

:

$(window).on('dimensionchange', function(){ 
     self.ome();
     });
$(window).on('dimensionclear', function(){
     self.ome("clear");
     });    

OME:

// cleanup
if ( from == "clear") {
   contents.css({'height':'', 'max-height':''})
   return;
   }

.

+5
2

"wrap, panels, ct"

+1

, div. - , , .

function framing() {
    /*
        Pre         : ready.js, self
        Post            : design.js->framing
        Author          : Enes Ü.
        Date            : 15:30, 05 May 12
        Summary         : framing the page widthly/heightly
        Bugs/TODOs              : Frame heights are anormal and will be fixed. Prior=5
    */


    $("#right_menu").width($("#main").width()-$("#left_menu").width());
    $("#left_menu").height(getWinHeight());
    $("#top_menu").width($("#main").width()-$("#left_menu").width());
    $("#right_menu").height(getWinHeight()-$("#top_menu").height());
    $("#map_container").height(getWinHeight());
    /* 
     ******* lots of lines like above...
     */

    setTimeout(framing,100);
}
+2

All Articles