IE CSS Bug - How do I maintain a position:absolute when dynamic javascript content on the page changes

◇◆丶佛笑我妖孽 提交于 2019-12-01 11:44:04

Its a bug in the rendering engine. I run into it all the time. One potential way to solve it is to hide and show the div whenever you change the content (that in turn changes the height):

var divCol = document.getElementById('column');
divCol.style.display = 'none';
divCol.style.display = 'block';

Hopefully this happens fast enough that it isn't noticeable :)

Another workaround which worked for me and had no flickering effect was to add and remove a dummy CSS class name, like this using jQuery:

$(element).toggleClass('damn-you-ie')

If you are worried about getting a flicker from showing and hiding divCol you can ajust another css property and it will have the same effect e.g.

var divCol = document.getElementById('column');
divCol.style.zoom = '1';
divCol.style.zoom = '';
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!