Force-redraw DOM technique for WebKit-based browsers
September 25th, 2009Something I’ve tried when I had an issue with Safari 4 not properly layouting/rendering an element after setting a new value for its innerHTML:
element.style.webkitTransform = 'scale(1)';
This did the trick and should work with Safari, Chrome and other browsers that are based on WebKit.
If you need a more general solution for elements that don’t seem to render properly, try my text-node based trick.
Seems that browsers are a little bit too optimized, but as long as you can give them a nudge…
Tweet