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.

http://jsfiddle.net/nzbrg/16/

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:

http://jsfiddle.net/nzbrg/6

edit

the way have found make ie re-render page set overflow property on html:

$('html').css('overflow', 'auto'); 

http://jsfiddle.net/nzbrg/13/


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -