The core of My Library consists of one main file and three that add optional extensions. The main file must appear first and is typically included in the head element. The main file may be downloaded in minified form or tailored to specific needs with the online builder. The optional extensions are downloaded seperately and are typically included just before the end of body element. See the downloads page for more information.
This is an example of the typical structure:
<html> <head> ... <script type="text/javascript" src="mylib-min.js"></script> ... </head> <body> ... <script type="text/javascript" src="mylib-unclip.js"></script> <script type="text/javascript" src="mylib-fix.js"></script> <script type="text/javascript" src="mylib-domready.js"></script> </body> </html>
Note that the unclip and fix extensions are for the slide/clip effects and fixed positioning.
The preceding example assumes that the methods of the API will be called during page load. If this is not the case, then it is preferable to use this structure:
<html> <head> ... </head> <body> ... <script type="text/javascript" src="mylib-min.js"></script> <script type="text/javascript" src="mylib-unclip.js"></script> <script type="text/javascript" src="mylib-fix.js"></script> <script type="text/javascript" src="mylib-domready.js"></script> </body> </html>
Add-ons are downloaded seperately and extend the functionality of My Library. The files must be included after the main file.
This example shows the structure of a document that makes use of the Debug add-on:
<html> <head> ... <script type="text/javascript" src="mylib-min.js"></script> <script type="text/javascript" src="mylib-debug.js"></script> ... </head> <body> ... <script type="text/javascript" src="mylib-unclip.js"></script> <script type="text/javascript" src="mylib-domready.js"></script> </body> </html>
This example assumes that methods of the Debug add-on will be required during page load.
The Alert add-on is an alert/dialog widget.
The Debug add-on adds several methods to the API to facilitate trouble-shooting applications and the API.
The Scrolling Anchors add-on is a simple example that demonstrates the Scrolling Effects combination module.
The API is simply a collection of functions. The functions are encapsulated as methods of a global API object to prevent namespace collisions with other scripts. For reasons of performance, the structure of the API object is largely flat. See the object reference for more information.
The optional object wrappers adds several global constructor functions that provide an OOP interface for My Library and enable the chaining of API methods. See the object reference for more information.
Calling applications should always detect methods of the API as the interface adapts to its environment.
Immediate methods may be feature detected and called during page load.
Deferred methods may not be feature detected or called until the document is ready. See the attachDocumentReadyListener function for more information
Last Modified: 2 Feb 2010 22:58:00 GMT
dmark@cinsoft.net