Search code examples
jqueryflashfirefoxreloading

Flash reloading on first click to any link (default prevented) only in Firefox


I'd been following several answers to similar problems with no luck at all, so i decided to try asking by myself:

I have a page with several links that have to load data via Ajax using jquery and put the response inside a div. The main "tab" is a flash wich is inside a layer. Every time a user clicks on any of those links, flash container is resized to 0px and set visibility to hidden (trying to prevent the reload behaviour if display is set to none).

All works just fine EXCEPT the first time you click on any link that hides flash layer. In that particular case (only in Firefox) it resets the flash to initial state. I'm going nuts about this...

here is what i do, resumed:

1. when user clicks to link 
     -> visibility: hidden, height: 0px (to the SWF container)
     -> ajax call to load content, innerHTML native JS to put this content and
     -> .css('display', 'block') to content container
2. when user clicks to main link
     -> clear content container with .htm('')
     -> hide content container with .css('display','none')
     -> visibility: visible; height: 500px; to SWF Container

Any hints and/or solutions will be GREATLY appreciated!

Thanks in advance


Solution

  • Okay, i found a workaround

    It seems that the problem isn't about links. It seems to be about the first resize. So i found that if i set the height of the div to 0 in my static css file, and when i load the game i change it via javascript, no realoads are done in subsequent resizes.

    Hope this helps to anybody.