OK, how about this in Jmol.js:
jmolResize(w,h)
w or h <= 1 implies a percent; h missing defaults to w:
jmolResize(500,500)
jmolResize(400)
jmolResize(0.95,0.60)
jmolResize(0.95)
Ah, and here is the nicest part: I've modified Jmol.js to allow for
percentages as well in the jmolApplet command itself:
jmolApplet("95%")
or
jmolApplet(0.95)
Then the applet automatically resizes, far as I can tell -- tested in
Firefox, Opera, and IE on a PC. Looks like the browsers properly send
the information to the applet indicating resizes if the applet
width/height are given as percentages.
In playing with this, I notice that if the applet is in a DIV, then that
percent applies only to that div.
What's interesting is that with the capability of saving and restoring
the state now, we really could do just this -- have a button (on the
webpage, I think) that captures the state of the applet, designs a new
window with the appropriate resize functions, and inserts applet code
into the new window such that the state script is run.
....OK, I have that now in
http://www.stolaf.edu/academics/chemapps/jmol/docs/examples-11/new.htm
Just click on "new applet window" under the applet.
Let me know if this does not work.
Bob
Nick Greeves wrote:
> I agree this works well and made me think about how it could be used
> more widely.
>
> In ordinary web pages I often use the Open Link in New Window(Frame)
> feature of my browser (Safari) to create a new window of the content I
> want to scrutinise in more detail without losing the initial page. Or
> when you click on thumbnail image to see the full size picture....
>
> So how about a command for Jmol (and in the menu) that creates a New
> Window with a resizable Jmol frame. That way we can keep small windows
> as embedded items in web pages but have the capability to "blow them
> up" if required.
>
> All the best
>
> Nick
>
> --
>
> WWW Pages: http://www.liv.ac.uk/Chemistrywww/Staff/greeves.html
>
> Tel: +44 (0)151-794-3506 (3500 secretary)
>
>
>
> On 6 Mar 2007, at 13:28, [EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]> wrote:
>
>> From: Frieda Reichsman <[EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]>>
>>
>> Subject: Re: [Jmol-users] resize applet with window (was:
>>
>> Mol-graphics: Jmol & VB ?)
>>
>> To: [email protected]
>> <mailto:[email protected]>
>>
>> Cc: Bob Hanson <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>
>>
>> Message-ID: <[EMAIL PROTECTED]
>> <mailto:[EMAIL PROTECTED]>>
>>
>> Content-Type: text/plain; charset="us-ascii"
>>
>>
>> I changed the subject line to make this a bit easier to find in
>>
>> future, if someone is looking on the archives - and wow, it works
>>
>> beautifully-- what a great enhansonment! ;^)
>>
>
-------------------------------------------------------------------------
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