The First One:
(function($) {
$.fn.joey = function(options) {
debug(this);
var opts = $.extend({}, $.fn.joey.defaults, options);
return this.each(function() {
$this = $(this);
// build element specific options
var o = $.meta ? $.extend({}, opts, $this.data()) : opts;
// do something
});
};
// private function for debugging
function debug($obj) {
if (window.console && window.console.log)
window.console.log('joey selection count: ' + $obj.size());
}
;
// plugin defaults
$.fn.joey.defaults = {
// some options
};
})(jQuery);