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
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers