Hide java applet with jquery? Possible?

I am trying to find a way to hide a java applet () using jquery.

I have a link that opens a simple ajax fancybox ( http://fancybox.net ), is that it always turns out to be "behind" the actual java applet.

Is there a way to "hide" an applet or even unload it? I can reload it after closing fancybox (mostly asking for user confirmation).

+4
source share
3 answers

You can remove the DOM object or set its CSS property to hidden.

jQuery("#applet").remove(); 

or

 jQuery("#applet").hide(); 

You can also kill the applet :

  <script> document.MyApplet.killApplet(); </script> public void killApplet() { AccessController.doPrivileged(new PrivilegedAction() { public Void run() { // kill the JVM System.exit(0); return null; } }); } 

However, this stops the applet and throws JS errors in IE6

You can also set the applet size to (1,1) and set it when done.

 jQuery("#applet").height(1).width(1); 
+5
source

What I am doing is $ ('applet'). addClass ('hide');

 .hide { position: absolute; left: -10000px; } 

Do $ ('applet'). removeClass ('hide'); when you want to come back.

All other parameters will force you to restart the applet.

+5
source

Try something like this:

 var save=$('#applet').clone(); $('#applet').html(''); 

and when you need it

 $('#applet').html(save.html()); save=null; //to free this bit of memory 

not tested, but I expect it to work;)

+1
source

Source: https://habr.com/ru/post/1301369/


All Articles