In the jmolApplet call, don't use the full tag -- jmolApplet0 -- use
just an extension, and don't use "0", because that might be
misinterpreted by some browsers as 0.
document.getElementById("datadiv").innerHTML = jmolApplet(500, jmoltext, "1");
then, in your call to jmolScript, refer to that same extension.
onmouseover="this.style.backgroundColor='#66FF00'; jmolScript('select
resno = 150; color green;', '1');"
(You could use "jmolApplet0" above, but then the real id is
jmolAppletjmolApplet0.)
That should do it.
Mark Halling-Brown wrote:
>Dear jmol_developers
>
>Just a quick question.
>I am developing a website with embedded jmol applets.
>I am loading the jmol applet with an ajax call using the code below (N/B
>this is all working fine)
>
>########Javascript########
>jmolSetDocument(0);
>jmolInitialize("jmol")
>jmolSetAppletColor("#FFFFFF");
>document.getElementById("datadiv").innerHTML = jmolApplet(500, jmoltext,
>'jmolApplet0');
>
>#######HTML##########
><div id='datadiv'></div>
>
>I would like to colour certain residues on a onmouseover event like this:
>onmouseover="this.style.backgroundColor='#66FF00'; jmolScript('select
>resno = 150; color green;');"
>
>However this reports the error: "could not find applet jmolApplet0".
>I assume this is because it is inside a div.
>Has anyone got ideas how I tell jmolScript where to look??
>
>Cheers
>Mark
>
>
>
>
>
--
Robert M. Hanson
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
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Jmol-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-developers