javascript - IE height 100% incorrect after div removal -
if add green div of height page scroll-bars added, expected. when remove div scroll-bars disappear in browsers remain in ie , white void takes place of div, somehow div height not recalculated correctly after removal.
please see fiddle live demo, see works in browsers except in ie.
the problem seems resolved when removing overflow:scroll
html tag rule, unfortunately not option.
tested in latest versions of ie, chrome , ff , opera.
why happening , how can force ie display correct height after dom insertion ?
note when resize window white void space disappears immediately, need way happen without re-sizing window.
it seems when ie renders height @ 100%, if grows stay largest size it's new 100%. make shrink again, instead of giving height, need give min-height - change html , body css to
body, html {min-height:100%;}
this should make wrapper resize after green block removed:
edit
the way have found make ie re-render page set overflow property on html:
$('html').css('overflow', 'auto');
Comments
Post a Comment