Thanks for the info about jmolSetTarget, Angel; I wasn't aware of that
function. It seems odd to have that defined, yet still have targetSuffix
parameters in public API functions. Wouldn't it be best to either require a
call to jmolSetTarget, OR always pass targetSuffix as a parameter?
Personally I prefer the parameter; reliance of one function on another means
more typing and less clarity of behaviour, imo.
2009/6/13 Angel Herráez <[email protected]>
> (several comments here to different previous posts)
>
> Nick, you can also resize the applet by setting the width and heigth
> properties of the applet object (which is what the jmolResize function
> will be doing), like this:
>
> <input type="button" value="resize applet"
> onClick="document.getElementById('jmolApplet0').width=100">
>
> and this can be invoked, if you prefer so, from within a Jmol script:
>
> <input type="button" value="resize from JmolScript" onClick="doit()">
>
> function doit()
> { jmolScript('load AMP.mol; javascript
> "document.getElementById(\'jmolApplet0\').width=100" ')
> }
>
> (the separate function is to ease the problem of multiple nested
> quotes)
>
>
> > It'd be neat if it could be tied to the size of the bounding box of
> the loading molecule...
> > -Tom
>
> I don't see that, since the bounding box will have a size in angstroms
> and the applet uses pixels. Oh, maybe you can calculate some form of ratio.
>
>
> David, if jmolResize(w,h) doesn't have a targetSuffix parameter, if
> will most likely use the current setting of setJmolTarget, which is used by
> jmolButton and the likes. I haven't checked that in Jmol.js, but it makes
> sense. No need to implement an applet-search- and-define-as-target script, I
> think.
>
> Oh yes, Jmol.js includes the jmolResize function with these comments:
>
> // jmolResize(w,h) -- resizes absolutely or by percent (w or h 0.5
> means 50%)
> // both w and h are optional.
> // if either is between 0 and 1, then it is taken as percent/100.
> // if either is greater than 1, then it is taken as a size.
>
> However, it is not documented in the Jmol.js documentation; I will add
> it there.
> http://jmol.sourceforge.net/jslibrary/
>
> Ah, I now see the "var applet = _jmolGetApplet(0);" bit that David was
> quoting. I think that's been overlooked and should be fixed. It most
> probably should use jmolSetTarget(). Do you agree, Bob?
>
>
>
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>
--
- N David Brown
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users