Search code examples
sifr

sIFR and display: none


sIFR doesn't seem to work on objects with display set to none. I've tried calling sIFR.redraw() after setting display to block but the replacement isn't showing up. Am I just calling the wrong method?


Solution

  • sIFR can't calculate an element that isn't displayed, because the dimensions are 0x0. The alternative is to offset it via

    el { position:absolute; left:-999em; top:-999em; }
    

    You can also use overflow:hidden on the parent element to clip it away, when you need to show it you just re-set the element's position to 'static'.