OK, so in case this is useful to anyone in the future, I will post here what I
have achieved.
The idea is to a have a custom text displayed on hovering the mouse pointer
over the
atoms, and that custom text is restricted to and specific for certain atoms.
(By default, hover text can be set using the "hover" command, but applies the
same text for
all atoms.)
There are other ways to do this, particularly using JmolScript all through, but
this is one
working fine in a webpage and mostly run via JavaScript:
<script type="text/javascript">
function customhover(aa,bb,cc)
{ jmolScript( 'if ({atomIndex=_atomHovered}&{site1}); hover "site 1";
else if
({atomIndex=_atomHovered}&{site2}); hover "site 2"; else; hover off; end if; ')
}
jmolApplet(300, 'load myMolecule.pdb; set hoverCallback "customhover"; define
site1
atomno=1,atomno=3,atomno=5,atomno=6; define site2
atomno=10,atomno=13,atomno=15;')
</script>
------------------------------------------------------------------------------
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users