I am looking for an easy way to select an option from a select list and be able to perform a number of actions on that option. One of the main operations is to edit the option. I would like to implement a context type menu by right clicking the option and then perform the action.
Does anyone know how to capture a 开发者_运维技巧right click on a select box option with jQuery?
I would like to use: http://abeautifulsite.net/blog/2008/09/jquery-context-menu-plugin/
Thanks!!!
The event has a "which" property that hols the "id" of the button pressed. You should use it with the "mousedown" event to prevent the browser's context menu to appear.
$("#selectBoxID").mousedown(function(e) {
    if (e.which == 1) {
        /*  left click action */
    }
    else if (e.which == 2) {
        /*  middle click action */
    }
    else if (e.which == 3) {
        /*  right click action */
    }
});
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论