Let's do some empirical testing...
Using Firefox...If I go to
http://chemapps.stolaf.edu/jmol/docs/examples-11/new.htm
and type into the command box:
set resizeCallback "callback"
and then press
CTRL-+
I get a callback. The original size was 350x350; the callback reports
389x389, then 429x429, etc.
Using MSIE 7 the callbacks are a bit different: 385, 420,....
So Jmol is reporting its correct size, and that size change depends upon the
browser.
Let's check CSS now:
originally:
clientHeight 350
clientWidth 350
later:
clientHeight 350
clientWidth 350
OK, so CSS does not change, but the applet callback reports a change, so
therefore we know the exact zoom setting.
What did you want to do with that? -- reset the applet size to some fraction
of that? Should be no real problem, I think....
Bob
On Wed, Mar 3, 2010 at 1:42 PM, Rolf Huehne <rhue...@fli-leibniz.de> wrote:
> Robert Hanson schrieb:
> > 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?
> >
> The problem here is number 5.
> Let's assume an initial size of 600x600 pixel. Then the browser zoom
> setting is changed to 130%. Now the applet is 780x780 pixel. But CSS
> will still report 600x600 pixel.
> If the resizeCallback would report the correct size (780x780), I could
> calculate the additional scaling factor 1.3.
> But when I use this factor to calculate a new CSS setting that will
> result in the desired size of 600x600 I will get a rounding problem:
> 600 / 1.3 = ~461.54
> So I would have to set the new CSS size either to 461 or 462. and then
> the applet will be either 599x599 or 601x601 pixel.
> So I will need a reliable non-CSS way to set the size directly without
> the additional factor.
>
> 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