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

后端 未结 3 868
野趣味
野趣味 2021-01-15 03:23

I have a page where there is a column and a content div, somewhat like this:

blahblahblah
相关标签:
3条回答
  • 2021-01-15 03:40

    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')
    
    0 讨论(0)
  • 2021-01-15 03:41

    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 = '';
    
    0 讨论(0)
  • 2021-01-15 03:47

    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 :)

    0 讨论(0)
提交回复
热议问题