Created
May 11, 2009 20:31
-
-
Save winton/110164 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (function($) { | |
| $.rotator = function(element_or_selector, options) { | |
| $(element_or_selector).plugin(options); | |
| }; | |
| $.rotator.defaults = { | |
| // default options | |
| }; | |
| $.fn.rotator = function(options) { | |
| // define vars here | |
| // Public methods | |
| $.fn.extend({ | |
| }); | |
| // Constructor | |
| return this.each(function() { | |
| initialize($(this)); | |
| }); | |
| // Private methods | |
| function initialize(el) { | |
| setOptions(el); | |
| // assign vars here | |
| } | |
| function setOptions(el) { | |
| if (options) | |
| options = $.extend({}, $.rotator.defaults, options); | |
| else if (!(options = el.data('rotator_options'))) | |
| options = $.rotator.defaults; | |
| el.data('rotator_options', options); | |
| } | |
| }; | |
| })(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment