Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12: Writing jQuery Plugins > A Closer Look at the Widget Factory

A CLOSER LOOK AT THE WIDGET FACTORY

It was touched on briefly, but the Widget Factory provides an alternative, powerful path to jQuery plugin development. It’s a slightly more advanced option, but it offers several features that might be beneficial depending on the style of plugin you’re looking to write. The following list outlines some of the useful features that come along automatically once you buy into the Widget Factory method of plugin creation. You’ll notice that many of these were touched on in previous sections. They come along for the ride with the Widget Factory.

  • Prevention of multiple instances of the plugin on the same object.
  • Methods to enable, disable, or destroy the widget.
  • Widgets are stateful, so destroying the instance returns the DOM element to its original state.

  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial