We will see how our plugin works under various circumstances.
Create an HTML document (or modify the example we used earlier).
<body> <h1>ImageCaption Script</h1> <p><img src="lake_mead.jpg" width="300" height="201" alt="Lake mead in a speeding car." /></p> <p><img src="clouds.jpg" width="150" height="101" /></p> <p><img src="red_rocks.jpg" width="300" height="201" title="A photo of Red Rock Mountain near Las Vegas, Nevada." /></p> </body>
In the
<head>
section of your HTML document, reference the MooTools Core library and the ImageCaption plugin, and create a section where we will instantiate our Caption class.<script type="text/javascript" src="mootools.js"></script> <script type="text/javascript" src="ImageCaption.js"></script> <script type="text/javascript"> $(window).addEvent('domready',function(){ // Instantiate...