I'm using the following as a basis for a jquery plugin but I seem to have some syntax issues from my .find onwards. The code within the click function won't get called and the class is not being applied. Can someone suggest where I may have gone wrong here please?
(function($){
$.fn.expandCollapse = function(options){
var opts = $.extend({}, $.fn.expandCollapse.defaults, options);
function initialize(){
$(this).each(function(){
// code
}).find("p").click(function(){
// code
}).end().not(:first).addClass(opts.c);
}
initialize();
return $(this);
};
$.fn.expandCollapse.defaults = {
c: "collapsed"
};
})(jQuery);