Proteopedia:DIY:Macros: Difference between revisions
mNo edit summary |
mNo edit summary |
||
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: | ||