I've always been bothered about having to statically declare the size of
a Java applet window (container?) in the calling HTML. I've always
wanted the moral equivalent of width=50% statement (of the window or
frame). I'm trying to use Javascript to do so.
I can sort of get an example working in a Mozilla browser:
[color=blue]
> <!-- This works on Mozilla only (and maybe netscape) -->
> <script language="Javas cript">
> document.write( "<applet code=MyApplet.c lass width="
> + window.innerWid th/2 + " height=" + window.innerWid th/2 +[/color]
"></applet> <br>" ); </script>
So the document.write statement produces a normal looking applet string
like this:
<applet code=MyApplet.c lass width=252.5 height=252.5></applet>
Which gets intepreted by the browser, kicking off the Java applet. But
as you resize the browser the alignment with other text in the html
window is funky. Also, in the above example, the window.innerWid th is
apparently from the Mozilla/Netscape DOM, not MS-IE's.
Does anybody have any Javascript examples of how to dynamically presize
an applet to some percentage of the window/frame width? (that's mostly
portable)
--
Ben in DC
PublicMailbox@b enslade.com (put 030516 anywhere in the subj to get thru)
"It's the mark of an educated mind to be moved by statistics"
Oscar Wilde
a Java applet window (container?) in the calling HTML. I've always
wanted the moral equivalent of width=50% statement (of the window or
frame). I'm trying to use Javascript to do so.
I can sort of get an example working in a Mozilla browser:
[color=blue]
> <!-- This works on Mozilla only (and maybe netscape) -->
> <script language="Javas cript">
> document.write( "<applet code=MyApplet.c lass width="
> + window.innerWid th/2 + " height=" + window.innerWid th/2 +[/color]
"></applet> <br>" ); </script>
So the document.write statement produces a normal looking applet string
like this:
<applet code=MyApplet.c lass width=252.5 height=252.5></applet>
Which gets intepreted by the browser, kicking off the Java applet. But
as you resize the browser the alignment with other text in the html
window is funky. Also, in the above example, the window.innerWid th is
apparently from the Mozilla/Netscape DOM, not MS-IE's.
Does anybody have any Javascript examples of how to dynamically presize
an applet to some percentage of the window/frame width? (that's mostly
portable)
--
Ben in DC
PublicMailbox@b enslade.com (put 030516 anywhere in the subj to get thru)
"It's the mark of an educated mind to be moved by statistics"
Oscar Wilde
Comment