0
我想用contextmenu編輯控件。當我點擊右鍵點擊,我需要獲得菜單ID號碼,但它只寫第一個菜單ID。我該如何解決它?用Contextmenu選擇ID
$('#kutu').bind('contextmenu',function(e){
var $cmenu = $(this).next();
var ix = $(this).parent().find("h1").parent().find("div").html();
$("#bilgiler").html(ix);
$('<div class="overlay"></div>').css({left : '0px', top : '0px',position: 'absolute', width: '100%', height: '100%', zIndex: '100' }).click(function() {
$(this).remove();
$cmenu.hide();
}).bind('contextmenu' , function(){return false;}).appendTo(document.body);
$(this).next().css({ left: e.pageX, top: e.pageY-15, zIndex: '101' }).show();
return false;
});
和我的PHP代碼菜單..
echo '<H1 class="ustBaslik" id="fakulteBilgileriH1">';
echo '<img src="../resimler/bolge.png" alt="" /> '.$cek["KategoriIsmi"].$cek["KategoriID"];
echo '<div style="display:none">'.$cek["KategoriID"].'</div></H1>';
測試:http://jsfiddle.net/6KdKC/3/
謝謝大家:) – Actionsee