本文主要介紹了詳解bootstrap用dropdown-menu實現上下文選單的相關資料,希望透過本文能幫助到大家,需要的朋友可以參考下,希望能幫助到大家。
詳解bootstrap用dropdown-menu實作上下文選單
#寫在前面:
<p id="settingInGraph"> <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu" id="contextMenu"> <li><a tabindex="-1" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >任务指派</a></li> <li><a tabindex="-1" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >任务监听</a></li> <li><a tabindex="-1" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >任务表单</a></li> <li class="pider"></li> <li><a tabindex="-1" href="#" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >...</a></li> </ul> </p>
#
$("#settingInGraph").mousedown(function(e) { if (3 == e.which) { document.oncontextmenu = function() {return false;} $("#contextMenu").hide(); $("#contextMenu").attr("style","display: block; position: fixed; top:" + e.pageY + "px; left:" + e.pageX + "px; width: 180px;"); $("#contextMenu").show(); } }); $("#settingInGraph").click(function(e) { $("#contextMenu").hide(); });
實例講解bootstrap paginator分頁插件的兩種使用方式
以上是實例詳解bootstrap用dropdown-menu實現上下文選單的詳細內容。更多資訊請關注PHP中文網其他相關文章!