Proteopedia:DIY:Macros
From Proteopedia
(Difference between revisions)
m |
m |
||
Line 15: | Line 15: | ||
Integrating macro use into JSmol code is straightforward. | Integrating macro use into JSmol code is straightforward. | ||
- | '''Example #1: Calling a | + | '''Example #1: Calling a simple macro function''' |
This example doesn't require any parameter to act. It causes the structure shown to 'bobble'. | This example doesn't require any parameter to act. It causes the structure shown to 'bobble'. | ||
Line 61: | Line 61: | ||
</pre> | </pre> | ||
- | The <code><nowiki>bobble()</nowiki></code> button triggers the action. The other button uses <code><nowiki>exit</nowiki></code> to stop the looping bobble.< | + | The <code><nowiki>bobble()</nowiki></code> button triggers the action. The other button uses <code><nowiki>exit</nowiki></code> to stop the looping bobble.<br/> |
You can try the result here: | You can try the result here: | ||
Line 105: | Line 105: | ||
'''Example #3: Another showing supplying the macro a parameter''' | '''Example #3: Another showing supplying the macro a parameter''' | ||
- | |||
Example code: | Example code: | ||
Revision as of 04:13, 4 January 2021
Macros as a tool
Macros can be used in Proteopedia pages to call commonly used JSmol code. Macro functions can take parameters so that the code is general but can act on the specified item or items. Additional macros can be made.
This page is meant to be a resource for finding and using macros.
|