DidacticialsInstructionsLinksAbout Zenith |
To BeginA very simple ZeL ScriptTo begin, we will create our first ZeL script, the one that you have (n)ever dreamt : the one which do nothing: { Now, we add instructions : {
"do":[ {"goTo":"#header"},
]}{"wait":3000}, {"message":"This message will last 5 seconds", "duration":5000} The instructions are blocs that begin with "{" (left brace) and ends with "}" (right brace), and are seperated by comma. Serial instructions are surrounded by "[" (left bracket) and "]" (right bracket). An instruction can have several pairs (for instance, "message" instruction have "message" and "duration" elements) To learn more about those instructions, refer to the instructions listed on the menu to the left. Now, let us see optional base-pairs. Base-pairs are pairs that are at the first level of the ZeL script (the same level than the first "do"). The optional base-pairs are :
Now, if we complete our script : {
"debug":true, "url":"http://doc.zenith.free.fr", "do":[ {"goTo":"#header"},
]
}{"wait":3000}, {"message":"This message will last 5 seconds", "duration":5000}
Insertion of a ZeL scriptNow, we will see how to insert your ZeL scripts to your Web Pages. First, insert a piece of Javascript code : if you want to check that the user has the add-on Zenith, you can add a function that test the User-Agent Then, we add an HTML element to click on, with the attribute "zel" which is the name of the function that returns the ZeL script, to execute the ZeL script : And that's all :p, you can test it here : Vocabulary
|
© 2009 the Zenith Team.