| Adjusting a Site Layout With Mootools |
|
Attaching the JavascriptMake sure the MooTools javascript file is properly referenced in the HEAD of the document. Also, in this example, it is possible to add the javascript effects in the document itself, but in this example we will be storing it in another file to keep the HTML clean. (see the image below) Creating the LinksIn order to activate the javascript effect, we need links, of course, to tell the javascript to run. The link, in our example, that makes the layout shrink has a class of "smallRun" and the link for making it expand has a class of "largeRun". This will enable us to choose what effects to apply to the page when the specific link is clicked. ![]() Creating the JavascriptNow that the link is created, we can create the effect. Using Fx.Style we can control how wide we want the site (please note that this is built off a Tutorial Series previously created. You can view it here). Below is a flash file with the javascript file. Rollover the pieces of the javascript to see an explanation. Project FilesThis Quick Clips was requested by: Franco Danese Tags: Quick Clips Library Javascript Adjusting a Site Layout With Mootools |



