css3 - jQuery .outerHeight returning correct for parent and 0 for child -


i have function determines starting coordinates block of text. used create page can not scroll vertically, horizontally. creates columns of text, starting up/down, , when doesn't fit sends next column. in case blocks of text orders, must kept (i.e. if order doesn't fit in column, send next column, don't split it).

the issue i'm having determining whether block of text fits vertically on page (in it's own column, i.e. page height > block height) default width or if needs made wider accommodate data. element tested on passed in object, , when thiselement.outerheight(true), returns correct result. when thiselement.find('.orderheader').outerheight(true) 0.

why this?

i have included function provide context.

thank much.

    function determinestartcoordinates(lastelement,thiselement) {     var thiselementheight= thiselement.outerheight(true);     var lastelementposition= lastelement.position();     var lastelementtop= lastelementposition.top;     var lastelementleft= lastelementposition.left;     var lastelementheight= lastelement.outerheight(true);     var top= lastelementtop + lastelementheight ;     var viewerheight= parseint( $('#kds').css("height"));     var availableheight= viewerheight - top;     var heightclears= availableheight > thiselementheight;      if (heightclears) {         var coordinates= { "top" : top , "left" : lastelementleft};     }     else {         var lastelementwidth= lastelement.outerwidth(true);         if (viewerheight > thiselementheight) {             var coordinates= { "top" : 0 , "left" : lastelementwidth + lastelementleft };         }         else {      //#####################################################             //this             //the issue              var header= thiselement.find('.orderheader');             var headerheight= header.outerheight();                     // function incomplete until part of finished         }      }     var left= lastelementleft;     return coordinates }; 


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -