(moving this message from developers to jmol-users list)
Hello Mark
First, I don't think the error is specifically due to the applet
being inside a DIV. Maybe the onMouseOver event is being called
before the applet has had time to load. **No, see below
In any case, which element is the onMouseOver attached to? I'm quite
sure you cannot do it for the applet, and if you do it for the
enclosing div, it won't work since the applet covers it and does not
let the div bgcolor to show up. If you want the applet background to
change, you must use script "color background [x66FF00]"
Most important --and now I see that this may be the cause of the
error--, the parameter in jmolApplet is the applet suffix, not its
name. So, when you do
jmolApplet(500, jmoltext,'jmolApplet0')
you are in fact defining an applet with ID "jmolAppletjmolApplet0"
(see http://jmol.sourceforge.net/jslibrary/#jmolApplet)
Good luck
El 22 Apr 2008 a las 10:30, Mark Halling-Brown escribió:
> 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
>
>
>
> --
> ---------------------------------------------------------------------------
> Mark Halling-Brown | Tel: +44-20-7631-6839
> Research Associate |
> Room 359 | Fax: +44-20-7631-6803
> School of Crystallography |
> Birkbeck College | Email:
> Malet Street | [EMAIL PROTECTED]
> London WC1E 7HX | [EMAIL PROTECTED]
> UK |
> http://people.cryst.bbk.ac.uk/~ghall04
> ---------------------------------------------------------------------------
>
>
>
> -------------------------------------------------------------------------
> 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
-------------------------------------------------------------------------
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-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users