1. You know what size the applet is initially, because your callback will
report it.
2. You know what the applet size is in CSS by checking that
(document.getElementById("jmolApplet0").style.width, I think).
3. When the page opens and you get the resizeCallback, you correlate those.
4. If you get a resize callback you should be able to know if YOU did the
resize or the user did through zoom settings.
5. The CSS will report the new size, and Jmol will, too, perhaps. I don't
know.
6. Then just adjust the applet size to match the old size, making sure to
set a flag that disables the code in the callback for this next resize.
Right?
On Wed, Mar 3, 2010 at 12:39 PM, Rolf Huehne <rhue...@fli-leibniz.de> wrote:
> On 03/03/2010 06:30 PM, Robert Hanson wrote:
> > Here's an idea: You can set a resizeCallback that will let you know that
> the
> > applet was resized. (It returns the new width and height as second and
> third
> > parameters, respectively.) Then you could compare that with your CSS
> > settings and from that, I think, determine if the applet was resized by
> > zooming or not. Then resize the applet to your specifications. Be careful
> > not to get into an endless loop!
> >
> > Perhaps?
> >
> Thanks, Bob. It sounds good. But there still remains a problem:
> How to resize the applet without using the CSS property?
> As far as I remember it was the only reliable way I found that worked in
> all browsers tested.
> I could calculate a scaling factor but this will presumably end up in
> rounding problems (e.g.: 599x599 instead of 600x600).
>
> Regards,
> Rolf
>
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
--
Robert M. Hanson
Professor of Chemistry
St. Olaf College
1520 St. Olaf Ave.
Northfield, MN 55057
http://www.stolaf.edu/people/hansonr
phone: 507-786-3107
If nature does not answer first what we want,
it is better to take what answer we get.
-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users