问题
I have a sIFR replaced H2 link that simply toggles (w/ jQuery) another div on and off. 'Seems' to work in all browsers but Firefox 3. Any thoughts ?
<ul id="titlenav">
<li><h2><a href="javascript:void()">Title</a></h2>
<ul id="titlemenu">
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
</li>
</ul>
$('#titlenav h2').click(function() {
$('#titlemenu').Toggle();
});
My siFr replace config and css is ultra simple and sIFr links generally work, just not jquery functions. Im using ; - jquery-1.3.1 - sIFR 3 R 427
Any advice welcomed. I'm pretty new to all this.
回答1:
The problem is that the click event on the Flash doesn't propagate to the h2 element. Check out the onRelease callback, which you can specify as an argument to sIFR.replace. It's fired whenever you click on a replaced Flash movie.
回答2:
What OS are you using? I've heard there are problems getting sFIR to run correctly with alpha transparency on linux systems; it could be the cause.
If you're still having problems with this an alternative may be typeface.js which is all js, no flash.
回答3:
Hmm, I've never heard about this sIFR thingy before. Looks cool, though, that is, when I can get it to work. Apparently, most of the sIFR demos I found fail to work with FF3 on Ubuntu Linux. Finally, I found one which works, and also offers jQuery integration: http://dev.jquery.com/~gilles/sifr/, you might want to check it out.
来源:https://stackoverflow.com/questions/626595/sifr-jquery-toggle-not-working-in-ff3