Jmol/Interactivity: Difference between revisions
From Proteopedia
Jump to navigationJump to search
No edit summary |
No edit summary |
||
| Line 142: | Line 142: | ||
Before you use the template above, please remove the line breaks so that the entire command is on a single line, otherwise it does not work. | Before you use the template above, please remove the line breaks so that the entire command is on a single line, otherwise it does not work. | ||
===Buttons to store and retrieve orientation=== | |||
This pair of buttons allows to save an orientation by pressing the first button, and return to the same orienation by pressing the second. Multiple pairs of these buttons allow to choreograph an animation and play it by pushing the buttons. The orientations are not saved beyond a session, though. | |||
<jmol><jmolButton><script>view1 = script("show moveto")[11][0]</script><text>store view 1</text></jmolButton> </jmol> <jmol><jmolButton><script>script inline @{"moveto 1.0" + view1}</script><text>retrieve view 1</text></jmolButton></jmol> | |||
<nowiki> | |||
<jmol> | |||
<jmolButton> | |||
<script>view1 = script("show moveto")[11][0]</script> | |||
<text>store view 1</text> | |||
</jmolButton> | |||
</jmol> <jmol> | |||
<jmolButton> | |||
<script>script inline @{"moveto 1.0" + view1}</script> | |||
<text>retrieve view 1</text> | |||
</jmolButton> | |||
</jmol></nowiki> | |||
Again, you can use a template to type less: | |||
<nowiki> | |||
{{subst:Store view buttons</nowiki> | |||
</StructureSection> | </StructureSection> | ||