jquery - Get DIV's height with overflow-y:scroll and updated content -
i have regular empty div overflow-y:scroll; update div content via $(elem).html(new_content);
now lost. need height of entire div new content. it'd done through scrolltop setting problem $(elem)[0].scrollheight zero!!
how solve issue?
update: solved issue. turns out call in callback function of jquery ui effect. call function supposed bring div visible. somehow though it's callback function div still not visible. so, had settimeout 10 ms , worked!!!
use .height() , check every time update div
function newcontent(){ $('#test').html(new_content); var h = $('#test').height(); console.log('new height ' + h); }
here's working jsfiddle: http://jsfiddle.net/f5k6h/
Comments
Post a Comment