views:

110

answers:

2

Ok, I'm using Jquery to build a dynamic menu, and sIFR to change the text to TrajanPro font.

This does not mix. I want to find a way to make it mix, though.

sIFR has automatic parsing of links, so that Flash sends you to the link location. What it doesn't do is pass on javascript triggers. I'm trying to make my menu as accessible as possible, by using hard links and then rewriting them with Jquery into managing the visibility of submenus, like this ~

(CSS)

.submenu {display: none;}

(Javascript)

       $("a#top1").click(function(event){
     $(".submenu").css("display","none");
     $("#sub1").css("display","block");
     event.preventDefault();
   });

...repeated for every top level menu link ID (#top2, #top3, #top4 - there are only 4 items.)

Does anyone know an easy way to get sIFR to treat javascript triggers nicely, without rewriting the core sIFR code (which is pretty much beyond my abilities)?

I know there are alternatives to sIFR such as image replacement, and I know some of you will probably suggest them - that's cool, but let me state my project goals up front:

1)degrades gracefully. If javascript is absent, the links still work, if images/flash fail to load the text is there instead of a red x and an alt tag.

2)scales nicely. I'm using ems for everything, and my boss views everything on an Iphone, and our customers are known to use everything from IE6 to Macbooks to lynx browsers, big screens and small. I need the text to 'fit' in all cases.

3)Has to work if Flash is absent. At least display text correctly. Damn Apple and their Ipads... (yes, I know sIFR relies on flash, it's got all kinds of tricks to degrade seamlessly though.)

4) there's not a whole lot of text or anything else on the page, so a bit of code bloat is ok, as long as the previous requirements are met. It'd be nice if I could keep my source order intact, though; the way I've got it now there's like 10 lines of code/header links before we're into the meat.

Thanks a bunch!!!

+1  A: 

Solved - Cufón (http://cufon.shoqolate.com/generate/) is a font-replacement solution that relies completely on javascript and javascriptable languages (SVG and VML), thus allowing the resulting element to be scripted like any other.

Rock!

Leaving this question up in case anyone else runs into the same problem.

Don Forrester
Would have to agree, sIRF is nice for headings, but anything dynamic or click-able is usually better served by Cufon. Just make sure you font licences allow you to use it. also works on the iPhone.
Matt
No worries on the license, it's Adobe stuff.
Don Forrester
Confirmed - Cufón works perfectly and passes all tests. I'm going to leave this post up in case anyone else has the same problem, though. Cheers!
Don Forrester
A: 

sIFR 3 has APIs for this, but it needs a bit of integration with your code base.

Mark Wubben