Adding CSS width support in sIFR
Every now and then you have the (miss fortunate) to need sIFR. I usually go for the jquery plugin. However, jquery sIFR measures the width of the html text (not the block itself) and then creates a matching flash. Since flash text is often wider, a line break appears.
Thus - jquery sIFR needs support for css width.
In jquery.sifr.js, efter line 297 (sendOptions[height]), add:
if( $each.css(width) !== "auto" ) {
sendOptions[width] = $each.css(width).replace('px','');
}else{
sendOptions[width] = sendOptions[width] || $alt[0][offsetWidth] || $alt[0][parentNode][offsetWidth] || $each.css(width);
}
Works for me..
Thus - jquery sIFR needs support for css width.
In jquery.sifr.js, efter line 297 (sendOptions[height]), add:
if( $each.css(width) !== "auto" ) {
sendOptions[width] = $each.css(width).replace('px','');
}else{
sendOptions[width] = sendOptions[width] || $alt[0][offsetWidth] || $alt[0][parentNode][offsetWidth] || $each.css(width);
}
Works for me..

Leave a comment