On Oct 20, 2006, at 3:46 PM, Patrick J. Carroll wrote:
>
> I need a small (?) amount of javascript help. Is there a way to
> tell which
> menu item in a jmolMenu has been selected? I am dealing with
> selecting a
> symop from a jmolMenu and then applying a translation to that symop by
> selecting a new symop which is the old symop with a translation. Do
> I make
> myself clear? I don't want to just use the "translate selected"
> command
> because that removes the first molecule.
>
the pure javascript method is to loop through the array of options
looking for the selected flag:
for (var i=0; i<myform.myselect.options.length; i++) {
if (myform.myselect.myoptions[i].selected) {
// do something here
}
}
I don't know if Jmol.js has a pre-canned method for this, though it
would be pretty easy to roll your own. (and maybe include it in the
next release?) :-)
hope that helps!
tim
--
Timothy Driscoll em: [EMAIL PROTECTED]
Virginia Bioinformatics Institute ph: 540-231-3007
Bioinformatics I: M-1 im: molvisions
Washington St., Blacksburg, VA 24061
"All I've got now is a long time, and a slow, slow burn."
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users