Stop applet execution on load, pause/resume using javascript?
I'm making something of a java applet gallery for my website (processing applets, if you're interested) and I'd like to keep the applets from running when the site first loads. Then, when the appropriate button is clicked, a piece of javascript would tell the applet to continue execution until another button is pressed to stop it. I know that I can use appletName.start() and appletName.stop(), but it doesn't seem to work 开发者_如何学编程on load, at least not well. I'm using element.getElementsById( "applet" ) to get the applets to use the start and stop methods on. It slows Firefox to a crawl for some reason.
Do you inject the applets with JavaScript or are they already in the HTML?
You need to poll for appletName.isActive()
, than you should get an applet that reacts to your pause/resume calls.
精彩评论