views:

342

answers:

3

I got a menu powered by SIFR like this:

<h2><a href="images/logo.jpg">IDENTIIES</a></h2><br>

I've setup the different states of the a:link style and I'd like this link to stay in another color when it has been clicked on (until another link is clicked on).

I think this has something to do with javascript, but I can't make this work.

Can someone please help?

A: 

If you add a selected class to the link that has been selected you should have to different selectors. One for not selected and one for selected.

<h2 class="selected"><a href="images/logo.jpg">IDENTIIES</a></h2>
<h2><a href="images/logo.jpg">NOT SELECTED</a></h2>

Then use these selectors for sIFR replacements with a different style. Could be something like this:

sIFR.replace(YourFont, { 
  selector: 'h2 a',
  css: [ '.sIFR-root {color: #FF0000;}' ]
});

sIFR.replace(YourFont, { 
  selector: 'h2 a.selected',
  css: [ '.sIFR-root {color: #FFFF00;}' ]
});
ck
(That wouldn't work because sIFR can't replace `<a>` elements directly. You should replace the `<h2>` and put the class on the `<h2>` as well.)
Mark Wubben
Thanks. Just changed it to code above.
ck
A: 

Thanks, But I meaned how can this link become "selected" without having me to already set it as "selected", I just want it to has a selected when I click on it, not prior to this. This will be used in a left frame menu, I want the people to know in which section they are thanks to this.

Any idea?

Thanks!

MATT
(Tip: you can add comments to answers if you'd like to discuss them.)
Mark Wubben
+1  A: 

Flash does not support this. JavaScript workarounds might be possible, but are workarounds at best. I advise you do not use sIFR for this scenario.

Mark Wubben