Adding CSS width support in sIFR

| | Comments (0)
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.. 

Categories

Leave a comment

About this Entry

This page contains a single entry by Niklas Bivald published on May 7, 2009 7:19 PM.

Duplicate a mysql database was the previous entry in this blog.

Wrapping PHP in itself is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.21-en