鼠标右键

来源:互联网 发布:c语言有趣小程序 编辑:程序博客网 时间:2024/04/30 11:36
<!doctype html><html><head><meta charset="utf-8">    <title>index</title>    <style>    *{    margin:0px;    padding:0px;            font-family: 微软雅黑;    }    ul{    width:270px;    height:235px;    border:1px solid #ccc;    padding:2px 5px;    position: absolute;    display: none;    }    ul li{        list-style: none;    font-weight: bold;    line-height: 25px;    }        ul li:hover{            background: #ccc;        }        span{margin-left: 100px;}    </style>    <script src="../jquery.min.js"></script></head><body><ul><li>返回(B)<span>Alt+向左箭头</span></li><li>前进(F)<span>Alt+向右箭头</span></li><li>重新加载(R)<span>Ctrl+R</span></li>        <hr /><li>另存为(A)...<span>Ctrl+S</span></li><li>打印为(P)...<span>Ctrl+P</span></li>        <li>投射(C)</li>        <hr />        <li>翻成中文</li>        <li>查看网页源代码<span>Ctrl+U</span></li>        <li>检查(N)<span>Ctrl+Shift+I</span></li></ul></body><script>$(document).contextmenu(function(event){x=event.clientX;    y=event.clientY;btn=event.button;//获取右键;if(btn==2){$('ul').show().css({'left':x+'px','top':y+'px'})       return false;//阻止谷歌出现}});$('ul li:eq(0)').css('color','#ccc');$('ul li:eq(1)').css('color','#ccc');</script></html>

原创粉丝点击