(function($) { $.fn.padma = function(opts) { this.each(function() { var that = this; var o = $.extend({ 'container': $('.padmaInfo'), 'tmpl': $('#padma_tmpl').html(), 'padmaUrl': that.attr("href"), 'no_of_images': 4, 'poster_size': 128, 'video_size': 128, 'timeline': true, 'on': 'hover' }, opts); if (typeof(o.container) == 'function') { var container = o.container(that); } else { var container = o.container; } }); }; })(jQuery);