<div id="opration" style="display:none;">
<ul>
<li><a href="#" onclick="downloadFile()">download</a></li>
<li><a href="#" onclick="openWindow()">openWindow</a></li>
</ul>
</div>
/*====================== 自定義右鍵菜單 ======================*/
$("#log_list").on("contextmenu","p[class='log']",function(ev) {
selectFileName = $(this).attr("fileName");
var oEvent = ev || event;
//自定義的菜單顯示
var menu = document.getElementById("opration");
menu.style.display = "block";
//讓自定義菜單隨鼠標的箭頭位置移動
menu.style.left = oEvent.clientX + "px";
menu.style.top = oEvent.clientY + "px";
//return false阻止系統自帶的菜單,
//return false必須寫在最後,否則自定義的右鍵菜單也不會出現
return false;
});