Samples/Tags for Controls
Tags in the Jmol Extension for MediaWiki that will include controls to act on modelsTags in the Jmol Extension for MediaWiki that will include controls to act on models
Extra line added as user Student
A model to test action of the controls in this page |
Drag the structure with the mouse to rotate |
All these tags will insert controls in the page at the same time the page is being loaded. The controls allow the user to apply a script, included in the tag, to the model displayed in a JSmol panel.
These tags must be surrounded by a <jmol> </jmol>
tag pair and will act on a model created by a jmolApplet
subtag.
Several 2nd-level subtags maybe enclosed in a single <jmol> </jmol>
tag pair, but no line breaks will be offered.
Important: the content of the target
subtag must match the content of the name
subtag of the jmolApplet
on which the action is desired.
Note: initial spaces are not allowed in some of the subtag contents.
Many of the 3rd and 4th-level subtags are optional and will take default values based on the sibling subtags (e.g. text defaults to the first characters of script).
jmolLinkjmolLink
Will include as 3rd-level subtags
target
, text
, script
Example code: | Renders: |
---|---|
<jmol> <jmolLink> <text>spacefill</text> <script>spacefill on;</script> </jmolLink> </jmol> |
|
jmolButtonjmolButton
Will include as 3rd-level subtags
target
, text
, script
Example code: | Renders: |
---|---|
<jmol> <jmolButton> <text>ball and stick</text> <script>spacefill on;</script> </jmolButton> </jmol> |
|
jmolCheckboxjmolCheckbox
Will include as 3rd-level subtags
target
, text
, scriptWhenChecked
, scriptWhenUnchecked
, checked
Example code: | Renders: |
---|---|
<jmol> <jmolCheckbox> <text>spin the model</text> <scriptWhenChecked>spin on;</scriptWhenChecked> <scriptWhenUnchecked>spin off;</scriptWhenUnchecked> </jmolCheckbox> </jmol> |
|
jmolMenujmolMenu
Will include as 3rd-level subtags
target
, menuheight
and several item
's
Each item
subtag will include 4th-level subtags:
text
, script
and, only in one of them, checked
Example code: | Renders: |
---|---|
<jmol> <jmolMenu> <item> <checked>true</checked> <text>cpk colors</text> <script>color cpk;</script> </item> <item> <text>all red</text> <script>color red;</script> </item> <item> <text>all blue</text> <script>color blue;</script> </item> </jmolMenu> </jmol> |
|
jmolRadioGroupjmolRadioGroup
Will include as 3rd-level subtags
target
, vertical
and several item
's
Each item
subtag will include 4th-level subtags:
text
, script
and, only in one of them, checked
Example code: | Renders: |
---|---|
<jmol> <jmolRadioGroup> <item> <checked>true</checked> <text>ball and stick</text> <script>spacefill 23%; wireframe 0.15;</script> </item> <item> <text>sticks only</text> <script>spacefill off; wireframe 0.3;</script> </item> <item> <text>spacefill</text> <script>spacefill on; wireframe off;</script> </item> </jmolRadioGroup> </jmol> |
|
<jmol> <jmolRadioGroup> <vertical>true</vertical> <item> <checked>true</checked> <text>ball and stick</text> <script>spacefill 23%; wireframe 0.15;</script> </item> <item> <text>sticks only</text> <script>spacefill off; wireframe 0.3;</script> </item> <item> <text>spacefill</text> <script>spacefill on; wireframe off;</script> </item> </jmolRadioGroup> </jmol> |
|
<< Back to the Samples.