Skip to content

Instantly share code, notes, and snippets.

@sagarjadhav
Last active December 15, 2015 23:59
Show Gist options
  • Save sagarjadhav/5344457 to your computer and use it in GitHub Desktop.
Save sagarjadhav/5344457 to your computer and use it in GitHub Desktop.
jQuery Plugin Initial Code
/* 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