Time for action – adding a license and defining configurable options

In a new file create the following outer structure for the plugin:

/*
  Plugin name jQuery plugin version 1.0

  Copyright (c) date copyright holder

  License(s)

*/

;(function($) {

  $.tranzify = {

    defaults: {
      transitionWidth: 40,
      transitionHeight: "100%",
      containerID: "overlay",
      transitionType: "venetian",
      prevID: "prev",
      nextID: "next",
      visibleClass: "visible"
    }
  };

})(jQuery);

What just happened?

All plugins should contain information on the plugin name and version number, the copyright owner (usually the author of the code) and the terms, or links to the terms, of the license or licenses it is released under.

The plugin is encapsulated within an anonymous function so that its variables ...

Get jQuery 1.4 Animation Techniques Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.