0
我在這裏遇到了一個jQuery插件的問題。用jquery插件右鍵點擊屬性
我想從該文本菜單一直呼籲這樣我就可以把一個選項,如「刪除(PHOTOID)」菜單中的圖像獲取屬性「PHOTOID」。
換句話說:在.imgPrev(見下面的HTML)我右擊,我希望屬性PHOTOID在菜單中使用。
這裏是插件:jQuery ContextMenu Plugin
代碼:
$('.imgPrev').contextMenu(menu,{beforeShow: function() {
alert($('.imgPrev').attr('photoId'));
return true;
}});
圖片是這樣的:
<div class="imgPrev"><img str="..." photoId="541"></div>