views:

77

answers:

2

Hello,

sIFR 3 is behaving strangely in Firefox.

The actual sIFR flash element is set within a box that is 412px wide. In IE, Chrome, Safari, etc., the with of the Flash element is a consistent 412px; however, in Firefox, the Flash element is briefly as wide as the Body element, before correcting itself. When the page finishes loading, sometimes the Flash element remains that wide, breaking the layout (the Flash text flows underneath the sidebar to the right).

Setting a width in the CSS for the .sIFR-flash element causes it to remain the proper 412px wide, but the text doesn't wrap at all--it just cuts off at the right edge, and the height of the flash element remains one line high.

The markup is simple; it's just an h2 within a div.

My sIFR code:

var clerkenwell = { src: '/flash/sifr.swf' };

sIFR.activate(clerkenwell);

sIFR.replace(clerkenwell, {  
    selector: '.post h2',  
    css: '.sIFR-root { color: #1899c4; text-transform:uppercase; font-size:30px; }',  
    transparent: 'true',  
});

Setting forceWidth: 'true', just causes the same problem as using a CSS width on the .sIFR-flash element.

So: how can I get the sIFR text to remain as wide as its containing element while allowing for line breaks in Firefox?

Thanks for any and all help!

A: 

This isn't really an answer to your question; but I recently converted a large website from sIfr to Cufon and it was a breeze! It was way simpler than sIfr, easy to setup, and much faster as well. The poor performance and misc headaches (like yours) drove me to switch and I'm happy with it.

Daniel Beardsley
Must say I agree, did exactly the same thing recently and never looked back
bateman_ap
Unfortunately, the font we're using isn't compatible with Cufon. I've used Cufon on a project or two before and loved it, especially compared to sIFR, but I'm afraid sIFR is our only option.Would just do images-as-text and call it a day, but this is going to be a dynamic, WordPress-powered site, so the headings need to work properly.
bigsweater
A: 

FINALLY found the fix, from another StackOverflow post.

The problem was solved by uncommenting sIFR.useStyleCheck = true; in sifr-config.js. I'd love to know why that worked, but the answer to that is probably over my head. :)

bigsweater
"however, in Firefox, the Flash element is briefly as wide as the Body element, before correcting itself"`sIFR.useStyleCheck` causes sIFR to (attempt to) wait until the CSS has been applied. In other words it happens to wait with replacing until after the element has corrected itself.
Mark Wubben
I see. Thanks very much--I'll have to remember this trick.
bigsweater