I have an idea. Try changing this:
proto._createCanvas2d = function(doReplace) {
var container = Jmol.$(this, "appletdiv");
if (doReplace) {
...
to
proto._createCanvas2d = function(doReplace) {
var container = Jmol.$(this, "appletdiv");
if (true) {
...
(JSmol.min.js will have a different variable name for doReplace.)
Bob
On Thu, May 8, 2014 at 10:06 AM, Robert Hanson <hans...@stolaf.edu> wrote:
> That's not enough to go on. Yes, the applet is creating itself twice. As
> described above, we need to check what is happening with
>
> proto._createCanvas2d
>
> You must determine why it is running twice.
>
> Also, correct your <img> tag. It is not closed.
>
>
>
>
> On Thu, May 8, 2014 at 4:50 AM, Angel Herráez <angel.herr...@uah.es>wrote:
>
>> I'm having a similar problem as Jonathan's. Two canvas2d objects are
>> created.
>>
>> I believe there is something wrong with Jmol.getAppletHtml()
>> The problem does not happen when I use Jmol.getApplet() directly in the
>> div.
>>
>> Note: I am using jquery-1.10.2.min.js plus JSmol.min.nojq.js
>>
>> Symptoms:
>>
>> - The page is taller (scroolbar) than its intended contents.
>>
>> - A square area below the actual JSmol square is sensitive to right-click
>> opening of the popup menu and also to zoom by mouse wheel.
>>
>> - Firefox Inspector gives this source code:
>> <div id="JmolOb_appletdiv" style="z-index: 15; width: 100%; height: 100%;
>> position: absolute; top: 0px; left: 0px; display: block;">
>> <script type="text/javascript"></script>
>> <canvas id="JmolOb_canvas2d" style="width: 100%; height: 100%;
>> z-index: 17;" width="400" height="400"></canvas>
>> <canvas id="JmolOb_canvas2d" style="width: 100%; height: 100%;"
>> width="400" height="400"></canvas>
>> </div>
>>
>>
>> This is my code in the page:
>>
>> <head>
>> <script>
>> /* viewerMolec is a global object-variable defined before, that holds
>> many
>> parameters for the page.
>> */
>> viewerMolec.infoJmol = {
>> color: '#'+viewerCfg.bkg,
>> height: '100%',
>> width: '100%',
>> j2sPath: viewerMolec.pathJmol + 'j2s',
>> jarPath: viewerMolec.pathJmol + 'java',
>> jarFile: 'JmolAppletSigned0.jar',
>> isSigned: true,
>> serverURL: viewerMolec.pathJmol + 'php/jsmol.php',
>> loadstructcallback: 'viewer_OnModelLoad',
>> pickcallback: 'viewer_OnAtomOrBondPicked',
>> measureCallback: 'viewer_OnMeasures',
>> script: 'set frank off; /*etc*/ ',
>> zIndexBase: 15,
>> z: 15,
>> deferUncover:true,
>> coverImage:'cover.png',
>> use: 'html5'
>> };
>>
>> $(document).ready( function() {
>>
>> $('#viewerViewer').html(Jmol.getAppletHtml('JmolOb',viewerMolec.infoJmol))
>> ;
>> });
>> </script>
>>
>> <style>
>> #viewer { width:800px; height:400px; position:relative; }
>> #viewerTools { width:49%; height:100%; position:absolute; left:0; top:0;
>> overflow:hidden; }
>> #viewerViewer { width:50%; height:100%; position:absolute; left:50%;
>> top:0; }
>> </style>
>> </head>
>>
>> <body>
>> <div id="viewer">
>> <div id="viewerTools">
>> // etc.
>> </div>
>> <div id="viewerViewer"><img src="cover.png">
>> </div>
>> </div>
>> </body>
>>
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Is your legacy SCM system holding you back? Join Perforce May 7 to find
>> out:
>> • 3 signs your SCM is hindering your productivity
>> • Requirements for releasing software faster
>> • Expert tips and advice for migrating your SCM now
>> http://p.sf.net/sfu/perforce
>> _______________________________________________
>> Jmol-developers mailing list
>> Jmol-developers@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/jmol-developers
>>
>
>
>
> --
> Robert M. Hanson
> Larson-Anderson Professor of Chemistry
> St. Olaf College
> Northfield, MN
> http://www.stolaf.edu/people/hansonr
>
>
> 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
>
>
--
Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr
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
------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
• 3 signs your SCM is hindering your productivity
• Requirements for releasing software faster
• Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Jmol-developers mailing list
Jmol-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-developers