The flashing you are seeing is because your elements are reinserted into the DOM. In this case, and specifically in IE10, they flash from the bottom to the top because you use .appendChild
, so it renders at the bottom of the page then flashes to the top once the CSS applies.
The flashing from bottom to top can be fixed by using .insertBefore
:
view.insertBefore(colFix, view.firstChild);
This does not fix the problem entirely, as it will continue to flash every time it is reinserted - just at the top now.
One way to stop the flashing is to stop reinserting the entire block, but keep a wrapper in place which has its content re-populated. This may still cause a visible jump, but I leave that to you to experiment.
Previous experimentation below, kept for the sake of others who may try and answer. The above provides the answer to the core question of "How can I remove the flickering" - i.e. stop continuously reinserting layout elements.
Here is a fiddle
This changed #col-fixed
and #head-fixed
to position: fixed;
and then in the javascript I changed lines where you appendChild to insertBefore the first child - this may not have any relevance once position: fixed
was applied.
view.appendChild(heaF);
view.insertBefore(colFix, view.firstChild);
I also commented out:
colFix.style.left = colHF.style.left = (holder.scrollLeft - view.offsetLeft) + "px";
heaF.style.top = colHF.style.top = (holder.scrollTop - view.offsetTop) + "px";