1

私はjqueryプラグインの基礎として以下を使用していますが、.find以降にいくつかの構文上の問題があるようです。クリック関数内のコードは呼び出されず、クラスは適用されません。誰かが私がここで間違っていたかもしれない場所を提案できますか?

(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);
4

1 に答える 1

4

このスニペットがあります:

not(:first)

引用符で囲んでみてください':first'

于 2009-03-25T22:21:23.470 に答える