my plugin callbacks not working
<p>I was developed a plugin for context menu of different div</p>

<pre><code>&lt;div&gt;
  &lt;div class='first'&gt;some data&lt;/div&gt;
  &lt;div class='second'&gt;some data&lt;/div&gt;
  &lt;div class='third'&gt;some data&lt;/div&gt;
  &lt;div class='fourth'&gt;some data&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>and menu to display as context menu</p>

<pre><code>&lt;ul id='cmenu'&gt;
 &lt;li id='menuItem1'&gt;Item1&lt;/li&gt;
&lt;li id='menuItem2'&gt;Item1&lt;/li&gt;
&lt;li id='menuItem3'&gt;Item1&lt;/li&gt;
&lt;li id='menuItem4'&gt;Item1&lt;/li&gt;
&lt;li id='menuItem5'&gt;Item1&lt;/li&gt;
&lt;li id='menuItem6'&gt;Item1&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>and my plugin is.</p>

<p>How this plugin works is change the list of menuitems for every division and as the callbacks for menu Items are also change.</p>

<pre><code>(function($) {
    $.fn.cnxtmenu = function(options) {
        var defaults = {
            'menuid' : '',
            item1 : function() {
            },
            item2 : function() {
            },
            item3 : function() {
            },
            item4 : function() {
            },
            item5 : function() {
            },
            item6 : function() {
            },
        }, opt = $.extend({}, defaults, options);
        console.log(opt);
        var mid = '#'+opt.menuid, seldiv;
        this.live({
            "contextmenu" : function(e) {
                //console.log(this);
                seldiv = $(this);
                if ($(this).hasClass('first')) {

                    //change the menu list

                } else if($(this).hasClass('second')){


                // change the menu list to display different items 

                } 
                else if($(this).hasClass('file-list')){
                //differ list

                }
                else if($(this).hasClass('dstore_file-list')){
                    //differ menu list
                }

                $(mid).css({
                    top : e.pageY + 'px',
                    left : e.pageX + 'px'
                }).show();
                return false;
            }
        });

        $(mid).children('li').unbind('click').click(function(e) {
            e.stopPropagation();
            e.preventDefault();
            //console.log(file + "at switch");
            switch(this.id) {
                case 'menuItem1':
                    opt.item1(this, seldiv);
                    break;
                case 'menuItem2':
                    opt.item2(this, seldiv);
                    break;
case 'menuItem3':
                    opt.item3(this, seldiv);
                    break;
case 'menuItem4':
                    opt.item4(this, seldiv);
                    break;
case 'menuItem5':
                    opt.item5(this, seldiv);
                    break;
case 'menuItem6':
                    opt.item6(this, seldiv);
                    break;


            }
            $(mid).hide();
            return false;
        });

        $(mid).click(function() {
            $(mid).hide();
        });
        $(document).click(function() {
            $(mid).hide();
        });

    }
})(jQuery);
</code></pre>

<p>and I am using this plugin like this.</p>

<pre><code>$('.first').cnxtmenu({menuid:'cmenu',
item1:some callbacks
...});
</code></pre>

<p>for all the three div assign different callbacks.</p>

<p>my problem is callbacks are not differing for the selectors.
and callbacks are triggering many times.</p>

<p>help me whats wrong in my code please</p>

<p>thanks in advance.</p>
