Hiding a Java applet using display: none causes firefox to kill the applet until it is visible again. It also seems to kill the applet if you position the applet out of view ie. position: absolute; left: -9999; Using visibility: hidden; will hide the applet without killing it, but then the applet still takes up space in the layout which doesn't work for my application. Does anyone know of a workaround to prevent firefox from killing java applets when they're hidden via display or a negative position offset??
The usage is a java upload applet that I'd like to hide during an upload without killing the upload.
The behaviour of applets while hidden is entirely browser-specific. Safari 4, for example, calls stop() when the user changes to a different tab and then start() when changing back to the applet tab (at least on mac it does, not sure about windows).
Rather than use position hacks, set the applet to a 1x1 pixel size. That leaves a white dot on the screen but is the only really cross-browser way to guarantee the applet stays active.
The issue isn't isolated to just Java applets. Flash and other plugins have the same issue. They do this save on resources and for backward compatibility.
I have cheated by changing visibility to hidden and setting the position to absolute and then putting it in a negative z order and other nasty tricks.