On 1 Apr 2007 at 20:09, Sérgio Ceroni da Silva wrote:
> Has anyone ever (thought about || felt the need for) adding support for
> the HTML <optgroup> tag in jmolMenu() function?
Hi Sérgio
I have tried and it's easy to do with a small change in Jmol.js. Here is the
mechanism, in
case someone has any suggestions; if people find it OK, I will update Jmol.js
soon.
Add the optgroup entry as one more element in the array that is passed to
Jmol.js. The
first element must be the caption for the group ("label" in HTML syntax); the
second and
(optional) third elements are not used.
Then add an extra element to signal the end of the group.
Example:
jmolMenu([
[null, ".... select ....", "selected"],
["color cpk", "- CPK pattern", null],
["#optgroup", "... Color by: ....", null],
["color structure", "- structure", null],
["color chain", "- chain", null],
["color group", "- group", null],
["#optgroupEnd", null, null],
["#optgroup", ".... Other colors: ....", null],
["color formalcharge", "- electric charge", null],
["color amino", "- amino-acids", null],
["color shapely", "- nucleotides", null],
["#optgroupEnd", null, null]
]);
The key words are "#optgroup" and "#optgroupEnd" which must be used exactly so.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users