Note that there are some explanatory texts on larger screens.

plurals
  1. POForcing IE8 to rerender/repaint :before/:after pseudo elements
    primarykey
    data
    text
    <p>so I've been toying with this calendar-ish thingy for a bit:</p> <ul> <li>Grid of divs (mimicking a table)</li> <li>Hovering over a table cell displays a tooltip with 2 icons each consisting of a div with :before and :after elements</li> <li>Icons change colour depending on colour of cell hovered and that of its previous sibling (cell's colour class is applied to the icon).</li> </ul> <p>Stripped down fiddle: <a href="http://jsfiddle.net/e9PkA/1/" rel="noreferrer">http://jsfiddle.net/e9PkA/1/</a></p> <p>This works fine in every browser but IE8 and below (IE lte 7 and I will never friends, but IE8 would be nice to have).</p> <p>IE8 notices the change of classNames and updates the divs' colour accordingly but completely ignores the colour changes implied by the :before and :after declarations, e.g.:</p> <pre><code>.wbscal_icon_arrival:before { width: 12px; height: 4px; left: -8px; top: 6px; background-color: silver; } .wbscal_icon_arrival.wbscal_full:before { background-color: #ff0000 !important; } </code></pre> <p>In the fiddle above, the :before/:after elements are coloured exactly once: the first time the tooltip is shown. </p> <p>In another version it would update everytime I'd move the mouse out of the "table" div, but not if the tooltip is hidden when hovering a "cell" div border.</p> <p>I've tried force-triggering repaints by adding/removing other classes to/from the element/its parents/the body, editing/accessing style attributes and whatnot so I guess it's not your average repaint problem.</p> <p>Is there a JS hack that fixes this and forces :before/:after to update?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload