Question

I'm making a website using the jQuery UI Tabs plugin which is great. However, one of my "hidden" tabs contains an .swf. Firefox only plays this .swf when that tab has been "opened" - which again is great. IE however plays this .swf while it is hidden, so when the user clicks on the tab, they see no animation in IE as it has already finished. How to make IE only play the swf when the tab has been opened?

Thanks in advance.

Was it helpful?

Solution

I'd use swfobject in this case.

$("#tab1").click(function() {    
    swfobject.embedSWF("some.swf", "someid", "445", "250", "9.0.0");
    return false;
});

OTHER TIPS

Why not have the animation start manually rather than automatically and then call a start function in the swf using javascript when the tab is shown?

Only assign the scr of the embed once the tab is clicked. That way onced clicked it loads the animation.

var flashURL = "http://url.com";
$( "#tab1" ).click(function(){
    $("#tab1 > embed").attr( "src", flashURL );
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top