User:Jaime Prilusky/Test/JSmolExtensionExamples: Difference between revisions

From Proteopedia
Jump to navigationJump to search
Jaime Prilusky (talk | contribs)
No edit summary
Jaime Prilusky (talk | contribs)
No edit summary
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Plain examples for JSMolExtension==
==Plain examples for [[User:Jaime_Prilusky/JSmolExtension|JSMolExtension]]==
<StructureSection load='3rec' size='340' side='right' caption='Caption for this structure' scene=''>
<StructureSection load='3rec' size='340' side='right' caption='Caption for this structure' scene=''>
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. __NOTOC__
==<i class="far fa-hand-point-right"></i> 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>.
<pre>
<jmol>
<jmolLink>
  <script>select all;label "%a";select _H;label off;select all;</script>
  <text>label atoms</text>
</jmolLink>
</jmol>
</pre>


<jmol>
<jmol>
  <jmolLink>
  <jmolLink>
   <script> select all; labels on; </script>
   <script>select all;label "%a";select _H;label off;select all;</script>
   <text>Turn on labels</text>
   <text>label atoms</text>
  </jmolLink>
  </jmolLink>
</jmol>
</jmol>
==<i class="far fa-hand-point-right"></i> jmolButton==
Replacing 'jmolLink' by 'jmolButton' will draw a button with the default style for the browser.
<pre>
<jmol>
<jmolButton>
  <script> select all; labels off; </script>
  <text>Turn off labels</text>
</jmolButton>
</jmol>
</pre>


<jmol>
<jmol>
Line 14: Line 35:
   <text>Turn off labels</text>
   <text>Turn off labels</text>
  </jmolButton>
  </jmolButton>
</jmol>
==<i class="far fa-hand-point-right"></i> 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>
</jmol>


<pre>
<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>
</pre>
==<i class="far fa-hand-point-right"></i> 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>
<pre>
<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>
</pre>
</StructureSection>
</StructureSection>
== References ==
== References ==
<references/>
<references/>

Latest revision as of 07:37, 14 July 2020

Plain examples for JSMolExtension

Caption for this structure

Drag the structure with the mouse to rotate

References

Proteopedia Page Contributors and Editors (what is this?)

Jaime Prilusky