0

このコードでは、JSON データを取得していますが、コンテキスト メニューを表示したいだけです..このコードを変更できますか..

    switch (htmlTagName) {
        case 'a':
            alert('a'+'isShiftExists:'+isShiftExists+'length:'+jQ(this).parents('td').find('div.wb_sm_m').length);
            if (jQ(this).parents('td').find('div.wb_sm_m').length > 0 && isShiftExists != -1) {
                //loop json array to build context menu
                jQ(this).parents('td').find('div.wb_sm_m').each(function() {

                    var jsonArr = JSON.parse(jQ(this).text());  //jsonArr contains the json array
                    alert(JSON.stringify(jsonArr));
                //loop items of the json array to find context menu item and link
                //                        jQ.each(jsonArr, function(key, val) {
                //                    
                //                            });
                });
            }
            break;

        case 'td':
            alert('td'+'isShiftExists:'+isShiftExists+'length:'+jQ(this).find('div.wb_sm_m').length);
            if (jQ(this).find('div.wb_sm_m').length > 0 && isShiftExists != -1) {
                //loop json array to build context menu
                jQ(this).find('div.wb_sm_m').each(function() {

                    var jsonArr = JSON.parse(jQ(this).text());  //jsonArr contains the json array
                    alert(JSON.stringify(jsonArr));
                });
            }
            break;

        default:
            break;
    }
4

1 に答える 1

0

コンテキストメニューの実装については、このコンテキストメニュープラグインデモページを確認してください。

于 2012-08-01T09:41:47.890 に答える