User:Jaime Prilusky/Test/JSmolExtensionExamples

From Proteopedia
Jump to navigation Jump to search

Plain examples for JSMolExtensionPlain examples for JSMolExtension

Examples below interact with the structure in the Jmol applet on the page. These are simple examples that execute the script inside <script> and </script>. You may use longer scripts.

jmolLink

The code below will create a green link (Proteopedia's links that interact with applets are green) with the text 'label atoms' that will execute the script inside <script> and </script>.

<jmol>
 <jmolLink>
  <script>select all;label "%a";select _H;label off;select all;</script>
  <text>label atoms</text>
 </jmolLink>
</jmol>

jmolButton

Replacing 'jmolLink' by 'jmolButton' will draw a button with the default style for the browser.

<jmol>
 <jmolButton>
  <script> select all; labels off; </script>
  <text>Turn off labels</text>
 </jmolButton>
</jmol>

jmolCheckbox

The code below draws this checkbox

<jmol>
 <jmolCheckbox>
  <scriptWhenChecked>select all;label "%a";select _H;label off;select all;</scriptWhenChecked>
  <scriptWhenUnchecked>select all; labels off;</scriptWhenUnchecked>
  <text>show labels</text>
 </jmolCheckbox>
</jmol>

jmolRadioGroup

<jmol>
  <jmolRadioGroup>
    <item>
      <text>labels on</text>
      <script>select all;label "%a";select _H;label off;select all;</script>
    </item>
    <item>
      <text>labels off</text>
      <script>select all; labels off;</script>
    </item>
  </jmolRadioGroup>
</jmol>

Caption for this structure

Drag the structure with the mouse to rotate

ReferencesReferences