Flash refreshes when hide/show using the jquery tabs plugin?
<div id="target">
<object height="100%" width="100%" type="application/x-shockwave-flash" data="main.swf" id="myContent" style="visibility: visible;"></object>
</div>
When the jquery tabs plugin $('#target').hide()
then $('#target').show()
,the main.swf is refreshe开发者_StackOverflow中文版d automatically,how to avoid this kind of refreshing?
UPDATE
Anyone knows of a jquery tabs plugin that can avoid this kind of issue,say,it doesn't call hide/show
internally?
I think it is because browser reloads the content of div each time hide/show it.
Try this instead:
$('#target').css('visibility', 'hidden'); //hide
$('#target').css('visibility', 'visible'); //show
You should notice, that when using 'visibility', the space where element was will not be taken by other elements, the element just becomes invisible, not disappears. this can be fixed by using absolute position.
Good luck!
Flash is reloaded when you play with the display of flash containers. You can either set the width and height to 0px or set the location of the container to some negative coordinates way off the screen (that's the method I use)
$("#target").css("width", "0px");
$("#target").css("height", "0px");
$("#target").css("left", "-500px");
$("#target").css("top", "-500px");
精彩评论