亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

代碼沒有寫錯,就是出不來效果呢?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

? ? <head>

? ? ? ? <title>右鍵菜單插件</title>

? ? ? ? <link href="http://www.xianlaiwan.cn/data/jquery.contextmenu.css" rel="stylesheet" type="text/css" />

? ? ? ? <link href="style.css" rel="stylesheet" type="text/css" />

? ? ? ? <script type="text/javascript" src="http://www.xianlaiwan.cn/data/jquery-1.8.2.min.js"></script>

? ? ? ? <script src="http://www.xianlaiwan.cn/data/jquery.contextmenu.js" type="text/javascript"></script>

? ? </head>

? ??

? ? <body>

? ? ? ? <div id="divtest">

? ? ? ? ? ? <div class="title"><span class="fl">點擊右鍵</span></div>

? ? ? ? ? ? <div class="content">

? ? ? ? ? ? ? ? <input id="btnSubmit" type="button" value="提交" />

? ? ? ? ? ? ? ? <div class="tip"></div>

? ? ? ? ? ? </div>

? ? ? ? ? ? <div class="contextMenu" id="sysMenu">

? ? ? ? ? ? ? ? <ul>

? ? ? ? ? ? ? ? ? ? <li id="Li3"><img src="http://img1.sycdn.imooc.com//52e4b34b0001bb6d00160016.jpg" alt="" />保存</li>

? ? ? ? ? ? ? ? ? ? <li id="Li4"><img src="http://img1.sycdn.imooc.com//52e4b3680001424900160016.jpg" alt="" />退出</li>

? ? ? ? ? ? ? ? </ul>

? ? ? ? ? ? </div>

? ? ? ? </div>

? ? ? ??

? ? ? ? <script type="text/javascript">

? ? ? ? ? ? $(function () {

? ? ? ? ? ? ? ? $("#btnSubmit").contextMenu("sysMenu",

? ? ? ? ? ? ? ? ? { bindings:

? ? ? ? ? ? ? ? ? ? ?{

? ? ? ? ? ? ? ? ? ? ? ? ?'Li3': function (Item) {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ?$(".tip").show().html("您點擊了“保存”項");

? ? ? ? ? ? ? ? ? ? ? ? ?},

? ? ? ? ? ? ? ? ? ? ? ? ?'Li4': function (Item) {

? ? ? ? ? ? ? ? ? ? ? ? ? ? ?$(".tip").show().html("您點擊了“退出”項");

? ? ? ? ? ? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ? ? ? ?}

? ? ? ? ? ? ? ? ? });

? ? ? ? ? ? });

? ? ? ? </script>

? ? </body>

</html>


正在回答

2 回答

? ? <link href="http://www.xianlaiwan.cn/data/jquery.contextmenu.css" rel="stylesheet" type="text/css" />

? ? ? ? <script type="text/javascript" src="http://www.xianlaiwan.cn/data/jquery-1.8.2.min.js"></script>

? ? ? ? <script src="http://www.xianlaiwan.cn/data/jquery.contextmenu.js" type="text/javascript"></script>


這塊的鏈接接改一下,把所有的http都改成https就可以了


0 回復 有任何疑惑可以回復我~
#1

qq_茗菛書笙_03882178

還有的就是你綁定的是點擊的那個按鈕$("#btnSubmit"),你需要鼠標右鍵那個點擊按鈕才能出效果,最好把這個改成 $("#divtest"),這樣你隨便在div里點右鍵都可以出效果
2018-09-07 回復 有任何疑惑可以回復我~

你是用的鼠標右鍵嗎?我用eclipse跑了這個例子是ok的,用鼠標右擊點下就會出來

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

代碼沒有寫錯,就是出不來效果呢?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號