From: Thomas H. <th...@sa...> - 2014-07-28 18:09:27
|
Correction, it works. I just realized the clicks must be super accurate. Thanks, T On Jul 28, 2014, at 10:45 AM, Thomas Hrabe <th...@sa...> wrote: > Hi, > > I followed Angel’s advise and tried to set my callback function according to the tutorials, > but no alert box pops up. > > Here’s my code taken from here: > http://wiki.jmol.org/index.php/Jmol_JavaScript_Object/Info#Callbacks > > What am I doing wrong? > > Thanks, > Thomas > > var ViewInfo = { > width: 520, > height: 520, > debug: false, > color: "000000", > addSelectionOptions: false, > serverURL: "http://chemapps.stolaf.edu/jmol/jsmol/php/jsmol.php", > use: "WEBGL", > //language: "en", // NOTE: LOCALIZATION REQUIRES <meta charset="utf-8"> (see JSmolCore Jmol.featureDetection.supportsLocalization) > jarPath: "./jsmol/java", > j2sPath: "./jsmol/j2s", > // jarFile: (useSignedApplet ? "JmolAppletSigned.jar" : "JmolApplet.jar"), > // isSigned: useSignedApplet, > disableJ2SLoadMonitor: true, > disableInitialConsole: true, > // readyFunction: null, > allowjavascript: true, > script: '', > noscript: true, > console: "none" > }; > > function myPick(a,b,c,d) { > alert('you clicked on atom with index=' + c); > }; > ViewInfo.pickcallback = "myPick"; > |