Last active
December 15, 2015 23:59
-
-
Save sagarjadhav/5344457 to your computer and use it in GitHub Desktop.
jQuery Plugin Initial Code
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
/* Utility : Object.create dosen't work all browsers. */ | |
if ( typeof Object.create !== 'function' ) { | |
Object.create = function( obj ) { | |
function F() {}; | |
F.prototype = obj; | |
return new F(); | |
}; | |
} | |
(function( $, window, document, undefined ) { | |
var Carousel = { | |
init: function( options, elem ) { | |
var self = this; | |
self.elem = elem; | |
self.$elem = $( elem ); | |
/* Extend Options */ | |
self.options = $.extend( {}, $.fn.rtTab.options, options ); | |
} | |
}; | |
$.fn.rtCarousel = function( options ) { | |
return this.each(function() { | |
var carousel = Object.create( Carousel ); | |
carousel.init( options, this ); | |
/* Store Data */ | |
$.data( this, 'rtCarousel', carousel ); | |
}); | |
}; | |
$.fn.rtCarousel.options = { | |
}; | |
})( jQuery, window, document ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment