jQuery in Action
Adding new wrapper methods
207
in any manner that they would like and then tell us which page element should be
used for each purpose. Furthermore, in order to give the page authors as much
leeway as possible, we'll define our plugin so that the authors can provide any
wrapped set of images to serve as thumbnails. Usually, thumbnails will be gath-
ered together as in our test page, but page authors are free to identify any image
on the page as a thumbnail.
used for each purpose. Furthermore, in order to give the page authors as much
leeway as possible, we'll define our plugin so that the authors can provide any
wrapped set of images to serve as thumbnails. Usually, thumbnails will be gath-
ered together as in our test page, but page authors are free to identify any image
on the page as a thumbnail.
To start, let's introduce the syntax for the Photomatic Plugin.
Command syntax: photomatic
photomatic(settings)
Instruments the wrapped set of thumbnails, as well as page elements identified in the
settings
hash, to operate as Photomatic controls.
Parameters
settings
(Object) An object hash that specifies the settings for the Photomatic. See
table 7.1 for details.
table 7.1 for details.
Returns
The wrapped set.
The wrapped set.
Figure 7.2 The Photomatic Tester that we'll use to put our plugin through its paces