Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding a java applet with jquery? Possible?

Tags:

jquery

applet

I'm struggling to find a way to hide a java applet () using jquery.

I have a link that opens up a simple ajax fancybox (http://fancybox.net) problem is that it always appears 'behind' the actual java applet.

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

like image 456
Disco Avatar asked Dec 22 '22 05:12

Disco


1 Answers

You can remove it's DOM object, or set it's 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 applets size to (1,1), and set it back when you're finished.

jQuery("#applet").height(1).width(1);
like image 91
Malfist Avatar answered Jan 03 '23 23:01

Malfist