【皇家赌场手机版】3种差别的ContextMenu右键菜单演示,3种分裂的ContextMenu右键菜单实今世码

3种分歧的ContextMenu右键菜单演示,contextmenu右键菜单

粗略利用的右键菜单,希望能辅助大家。上面是截图和实例代码

皇家赌场手机版 1【皇家赌场手机版】3种差别的ContextMenu右键菜单演示,3种分裂的ContextMenu右键菜单实今世码。
 

 实例预览

 

<!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> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <title>3种不同的ContextMenu右键菜单演示</title>
        <style type="text/css">
            .content{margin:0 auto;width:360px;}
            .content p{margin:20px 0 0 0;border:solid 1px #C5D8FF;background:#EDF2FF;padding:10px;}
        </style>
    </head>
    <body>

        <div class="container">
            <div class="demo">
                <div class="contextMenu" id="myMenu1">
                    <ul>
                        <li id="open"><img src="/api/jq/ContextMenu/images/folder.png" /> Open</li>
                        <li id="email"><img src="/api/jq/ContextMenu/images/email.png" /> Email</li>
                        <li id="save"><img src="/api/jq/ContextMenu/images/disk.png" /> Save</li>
                        <li id="delete"><img src="/api/jq/ContextMenu/images/cross.png" /> Delete</li>
                    </ul>
                </div>

                <div class="contextMenu" id="myMenu2">
                    <ul>
                        <li id="item_1">Item 1</li>
                        <li id="item_2">Item 2</li>
                        <li id="item_3">Item 3</li>
                        <li id="item_4">Item 4</li>
                        <li id="item_5">Item 5</li>
                        <li id="item_6">Item 6</li>
                        <li id="item_7">Item 7</li>
                        <li id="item_8">Item 8</li>
                    </ul>
                </div>

                <div class="contextMenu" id="myMenu3">
                    <ul>
                        <li id="item_1">Item 1</li>
                        <li id="item_2">Item 2</li>
                        <li id="item_3">Item 3</li>
                    </ul>
                </div>
                <div class="content">
                    <p class="demo1"><b>演示</b> 右键单击我的! !</p>
                    <p class="demo2">在这个段落里面右键点击触发菜单</p>
                    <p style="font-weight: bold;">
                        不显示菜单
                        显示第一项
                        全部显示
                    </p>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js"></script>
        <script type="text/javascript" src="/api/jq/ContextMenu/js/jquery.contextmenu.r2.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                //class为demo1的样式绑定此右键菜单
                $('.demo1').contextMenu('myMenu1', {
                    bindings: { //绑定事件   
                        'open': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Open');
                        },
                        'email': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Email');
                        },
                        'save': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Save');
                        },
                        'delete': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Delete');
                        }
                    }
                });
                //class为demo2的样式绑定此右键菜单

                $('.demo2').contextMenu('myMenu2', {
                    menuStyle: { //菜单样式
                        border: '2px solid #000'
                    },
                    itemStyle: { //菜单项样式
                        fontFamily: 'verdana',
                        backgroundColor: '#666',
                        color: 'white',
                        border: 'none',
                        padding: '1px'
                    },
                    itemHoverStyle: { //菜单项鼠标放在上面样式
                        color: '#fff',
                        backgroundColor: '#0f0',
                        border: 'none'
                    }
                });

                //class为demo3的样式绑定此右键菜单
                $('.demo3').contextMenu('myMenu3', {
                    onContextMenu: function(e) { //重写onContextMenu
                        if ($(e.target).attr('id') == 'dontShow')
                            return false;
                        else
                            return true;
                    },
                    onShowMenu: function(e, menu) { //重写onShowMenu事件,单独对id=showOne设置
                        if ($(e.target).attr('id') == 'showOne') {
                            $('#item_2, #item_3', menu).remove();
                        }
                        return menu;
                    }
                });
            });
        </script>
    </body>
</html>

【皇家赌场手机版】3种差别的ContextMenu右键菜单演示,3种分裂的ContextMenu右键菜单实今世码。  

简单利用的右键菜单,希望能支援我们。下边是截图和实例代码 实例预览
!DOCTYPE html…

简易利用的右键菜单,希望能帮衬大家。上边是截图和实例代码

皇家赌场手机版,简轻松单利用的右键菜单,希望能辅助大家。上边是截图和实例代码

简言之利用的右键菜单,希望能帮助大家。上面是截图和实例代码

皇家赌场手机版 2

皇家赌场手机版 3
 

皇家赌场手机版 4
 

实例预览

 实例预览

 实例预览

<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>3种不同的ContextMenu右键菜单演示</title>
<style type="text/css">
.content{margin:0 auto;width:360px;}
.content p{margin:20px 0 0 0;border:solid 1px #C5D8FF;background:#EDF2FF;padding:10px;}
</style>
</head>
<body>
<div class="container">
<div class="demo">
<div class="contextMenu" id="myMenu1">
<ul>
<li id="open"><img src="/api/jq/ContextMenu/images/folder.png" /> Open</li>
<li id="email"><img src="/api/jq/ContextMenu/images/email.png" /> Email</li>
<li id="save"><img src="/api/jq/ContextMenu/images/disk.png" /> Save</li>
<li id="delete"><img src="/api/jq/ContextMenu/images/cross.png" /> Delete</li>
</ul>
</div>
<div class="contextMenu" id="myMenu2">
<ul>
<li id="item_1">Item 1</li>
<li id="item_2">Item 2</li>
<li id="item_3">Item 3</li>
<li id="item_4">Item 4</li>
<li id="item_5">Item 5</li>
<li id="item_6">Item 6</li>
<li id="item_7">Item 7</li>
<li id="item_8">Item 8</li>
</ul>
</div>
<div class="contextMenu" id="myMenu3">
<ul>
<li id="item_1">Item 1</li>
<li id="item_2">Item 2</li>
<li id="item_3">Item 3</li>
</ul>
</div>
<div class="content">
<p class="demo1"><b>演示</b> 右键单击我的! !</p>
<p class="demo2">在这个段落里面右键点击触发菜单</p>
<p style="font-weight: bold;">
不显示菜单
显示第一项
全部显示
</p>
</div>
</div>
</div>
<script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript" src="/api/jq/ContextMenu/js/jquery.contextmenu.r2.js"></script>
<script type="text/javascript">
$(document).ready(function() {
//class为demo1的样式绑定此右键菜单
$('.demo1').contextMenu('myMenu1', {
bindings: { //绑定事件 
'open': function(t) {
alert('Trigger was ' + t.id + '\nAction was Open');
},
'email': function(t) {
alert('Trigger was ' + t.id + '\nAction was Email');
},
'save': function(t) {
alert('Trigger was ' + t.id + '\nAction was Save');
},
'delete': function(t) {
alert('Trigger was ' + t.id + '\nAction was Delete');
}
}
});
//class为demo2的样式绑定此右键菜单
$('.demo2').contextMenu('myMenu2', {
menuStyle: { //菜单样式
border: '2px solid #000'
},
itemStyle: { //菜单项样式
fontFamily: 'verdana',
backgroundColor: '#666',
color: 'white',
border: 'none',
padding: '1px'
},
itemHoverStyle: { //菜单项鼠标放在上面样式
color: '#fff',
backgroundColor: '#0f0',
border: 'none'
}
});
//class为demo3的样式绑定此右键菜单
$('.demo3').contextMenu('myMenu3', {
onContextMenu: function(e) { //重写onContextMenu
if ($(e.target).attr('id') == 'dontShow')
return false;
else
return true;
},
onShowMenu: function(e, menu) { //重写onShowMenu事件,单独对id=showOne设置
if ($(e.target).attr('id') == 'showOne') {
$('#item_2, #item_3', menu).remove();
}
return menu;
}
});
});
</script>
</body>
</html>

 

 

以上所述是小编给我们介绍的3种区别的ContextMenu右键菜单达成代码,希望对大家有着支持,若是大家有任何疑问请给自己留言,小编会及时复苏我们的。在此也特别多谢咱们对台本之家网址的支撑!

<!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> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <title>3种不同的ContextMenu右键菜单演示</title>
        <style type="text/css">
            .content{margin:0 auto;width:360px;}
            .content p{margin:20px 0 0 0;border:solid 1px #C5D8FF;background:#EDF2FF;padding:10px;}
        </style>
    </head>
    <body>

        <div class="container">
            <div class="demo">
                <div class="contextMenu" id="myMenu1">
                    <ul>
                        <li id="open"><img src="/api/jq/ContextMenuolder.png" /> Open</li>
                        <li id="email"><img src="/api/jq/ContextMenumail.png" /> Email</li>
                        <li id="save"><img src="/api/jq/ContextMenuisk.png" /> Save</li>
                        <li id="delete"><img src="/api/jq/ContextMenuross.png" /> Delete</li>
                    </ul>
                </div>

                <div class="contextMenu" id="myMenu2">
                    <ul>
                        <li id="item_1">Item 1</li>
                        <li id="item_2">Item 2</li>
                        <li id="item_3">Item 3</li>
                        <li id="item_4">Item 4</li>
                        <li id="item_5">Item 5</li>
                        <li id="item_6">Item 6</li>
                        <li id="item_7">Item 7</li>
                        <li id="item_8">Item 8</li>
                    </ul>
                </div>

                <div class="contextMenu" id="myMenu3">
                    <ul>
                        <li id="item_1">Item 1</li>
                        <li id="item_2">Item 2</li>
                        <li id="item_3">Item 3</li>
                    </ul>
                </div>
                <div class="content">
                    <p class="demo1"><b>演示</b> 右键单击我的! !</p>
                    <p class="demo2">在这个段落里面右键点击触发菜单</p>
                    <p style="font-weight: bold;">
                        不显示菜单
                        显示第一项
                        全部显示
                    </p>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js"></script>
        <script type="text/javascript" src="/api/jq/ContextMenu/js/jquery.contextmenu.r2.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                //class为demo1的样式绑定此右键菜单
                $('.demo1').contextMenu('myMenu1', {
                    bindings: { //绑定事件   
                        'open': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Open');
                        },
                        'email': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Email');
                        },
                        'save': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Save');
                        },
                        'delete': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Delete');
                        }
                    }
                });
                //class为demo2的样式绑定此右键菜单

                $('.demo2').contextMenu('myMenu2', {
                    menuStyle: { //菜单样式
                        border: '2px solid #000'
                    },
                    itemStyle: { //菜单项样式
                        fontFamily: 'verdana',
                        backgroundColor: '#666',
                        color: 'white',
                        border: 'none',
                        padding: '1px'
                    },
                    itemHoverStyle: { //菜单项鼠标放在上面样式
                        color: '#fff',
                        backgroundColor: '#0f0',
                        border: 'none'
                    }
                });

                //class为demo3的样式绑定此右键菜单
                $('.demo3').contextMenu('myMenu3', {
                    onContextMenu: function(e) { //重写onContextMenu
                        if ($(e.target).attr('id') == 'dontShow')
                            return false;
                        else
                            return true;
                    },
                    onShowMenu: function(e, menu) { //重写onShowMenu事件,单独对id=showOne设置
                        if ($(e.target).attr('id') == 'showOne') {
                            $('#item_2, #item_3', menu).remove();
                        }
                        return menu;
                    }
                });
            });
        </script>
    </body>
</html>
<!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> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <title>3种不同的ContextMenu右键菜单演示</title>
        <style type="text/css">
            .content{margin:0 auto;width:360px;}
            .content p{margin:20px 0 0 0;border:solid 1px #C5D8FF;background:#EDF2FF;padding:10px;}
        </style>
    </head>
    <body>

        <div class="container">
            <div class="demo">
                <div class="contextMenu" id="myMenu1">
                    <ul>
                        <li id="open"><img src="/api/jq/ContextMenu/images/folder.png" /> Open</li>
                        <li id="email"><img src="/api/jq/ContextMenu/images/email.png" /> Email</li>
                        <li id="save"><img src="/api/jq/ContextMenu/images/disk.png" /> Save</li>
                        <li id="delete"><img src="/api/jq/ContextMenu/images/cross.png" /> Delete</li>
                    </ul>
                </div>

                <div class="contextMenu" id="myMenu2">
                    <ul>
                        <li id="item_1">Item 1</li>
                        <li id="item_2">Item 2</li>
                        <li id="item_3">Item 3</li>
                        <li id="item_4">Item 4</li>
                        <li id="item_5">Item 5</li>
                        <li id="item_6">Item 6</li>
                        <li id="item_7">Item 7</li>
                        <li id="item_8">Item 8</li>
                    </ul>
                </div>

                <div class="contextMenu" id="myMenu3">
                    <ul>
                        <li id="item_1">Item 1</li>
                        <li id="item_2">Item 2</li>
                        <li id="item_3">Item 3</li>
                    </ul>
                </div>
                <div class="content">
                    <p class="demo1"><b>演示</b> 右键单击我的! !</p>
                    <p class="demo2">在这个段落里面右键点击触发菜单</p>
                    <p style="font-weight: bold;">
                        不显示菜单
                        显示第一项
                        全部显示
                    </p>
                </div>
            </div>
        </div>
        <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/1.11.3/jquery.min.js"></script>
        <script type="text/javascript" src="/api/jq/ContextMenu/js/jquery.contextmenu.r2.js"></script>
        <script type="text/javascript">
            $(document).ready(function() {
                //class为demo1的样式绑定此右键菜单
                $('.demo1').contextMenu('myMenu1', {
                    bindings: { //绑定事件   
                        'open': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Open');
                        },
                        'email': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Email');
                        },
                        'save': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Save');
                        },
                        'delete': function(t) {
                            alert('Trigger was ' + t.id + '\nAction was Delete');
                        }
                    }
                });
                //class为demo2的样式绑定此右键菜单

                $('.demo2').contextMenu('myMenu2', {
                    menuStyle: { //菜单样式
                        border: '2px solid #000'
                    },
                    itemStyle: { //菜单项样式
                        fontFamily: 'verdana',
                        backgroundColor: '#666',
                        color: 'white',
                        border: 'none',
                        padding: '1px'
                    },
                    itemHoverStyle: { //菜单项鼠标放在上面样式
                        color: '#fff',
                        backgroundColor: '#0f0',
                        border: 'none'
                    }
                });

                //class为demo3的样式绑定此右键菜单
                $('.demo3').contextMenu('myMenu3', {
                    onContextMenu: function(e) { //重写onContextMenu
                        if ($(e.target).attr('id') == 'dontShow')
                            return false;
                        else
                            return true;
                    },
                    onShowMenu: function(e, menu) { //重写onShowMenu事件,单独对id=showOne设置
                        if ($(e.target).attr('id') == 'showOne') {
                            $('#item_2, #item_3', menu).remove();
                        }
                        return menu;
                    }
                });
            });
        </script>
    </body>
</html>

你或者感兴趣的稿子:

  • jquery插件ContextMenu设置右键菜单
  • JQuery右键菜单插件ContextMenu使用指南
  • jQuery右键菜单contextMenu使用实例
  • JS组件Bootstrap
    ContextMenu右键菜单使用方法
  • 网页中右键作用的贯彻格局之contextMenu的接纳
  • 行使contextMenu插件落实Bootstrap
    table弹出右键菜单
  • 开垦 Internet Explorer
    右键效能表(ContextMenu)
  • jQuery插件ContextMenu自定义Logo

  

  

Leave a Comment.