Force DOM redraw/refresh on Chrome/Mac

前端 未结 24 1903
轻奢々
轻奢々 2020-11-22 02:11

Every once in a while, Chrome will render perfectly valid HTML/CSS incorrectly or not at all. Digging in through the DOM inspector is often enough to get it to realize the

24条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-22 03:11

    This seems to do the trick for me. Plus, it really doesn't show at all.

    $(el).css("opacity", .99);
    setTimeout(function(){
       $(el).css("opacity", 1);
    },20);
    

提交回复
热议问题