[ This follows a post and discussion held partly in jmol-developers 
and partly privately; I am posting it here since it may be of help to 
other users ]

Michael Marden wrote:

> thanks for your comments on the applet size.
> 
> In my case Visual Basic (VB) is providing the Web-window and Bob's 
> script is providing communication - via the hard disk.   I  added an 
> explicit VB button (command) to reset the applet to a new size, based on 
> the current window size; this works, but of course resets the molecule.  
> It was not reasonable to do it during resizing, since the round trip to 
> the disk is too slow.
> 
> I did try to paste in the suggestion by Angel H.:
> <script type="text/javascript">
> function resize(n)
> {
> document.getElementById("jmolApplet0").width = n
> document.getElementById("jmolApplet0").height = n
> }
> function resizeCSS(n)
> {
> document.getElementById("jmolApplet0").style.width = n+"px"
> document.getElementById("jmolApplet0").style.height = n+"px"
> }
> </script>
> 
> but I got errors.  Maybe Bob can tell me what exact form I need within 
> the current script he setup. 
> Overall we need an applet size that follows a percentage of the 
> Web-window (without having to pass external messages via the disk).   
> hopefully I can now respond via the Jmol users group.
> thanks again,


Michael, if you just need an applet that is sized a percent of the 
web page window, that can be done easily (I can send you my 
JavaScript code that works). The tricky part is to have the applet 
resize when the browser is resized. As pointed out by Miguel, this 
probably involves too many resize events and can choke Jmol, or the 
browser.
But a per-request resize should also be easy to have.

Please, advise


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to