87,908
社区成员
发帖
与我相关
我的任务
分享
$('#div1').bind('contextmenu',function(){
return false;
});
<html>
<head>
<SCRIPT src="./jquery-1.11.1.js" type="text/javascript"></SCRIPT>
</head>
<body>
<div id="aaa" style="height:1000px;widht:1000px;background:red">aaa
<div id="bbb" style="height:500px;width:500px;background:green">bbb</div>
</div>
</body>
<script>
$(document).ready(function() {
$("#aaa").bind('contextmenu',function(){
return false;
});
$("#bbb").mousedown(function(){
alert("bbb");
return false;
});
/*
*/
});
</script>
</html>
我这样也可以啊
版本 40.0.2214.111 m
<html>
<head>
<SCRIPT src="./jquery-1.11.1.js" type="text/javascript"></SCRIPT>
</head>
<body>
<div id="aaa" style="height:1000px;widht:1000px;background:red">aaa
<div id="bbb" style="height:500px;width:500px;background:green">bbb</div>
</div>
</body>
<script>
$(document).ready(function() {
$(document).bind('contextmenu',function(){
return false;
});
$("#bbb").mousedown(function(){
alert("bbb");
return false;
});
/*
*/
});
</script>
</html>
$('.file_list').mousedown(function(e){
var path = $(this).attr('path');
var name = $(this).attr('name');
var file_id = $(this).attr('file-id');
//var file_info = {'path':path, 'name':name, 'file_id':file_id};
//localStorage.setItem('file_info', file_info);
localStorage.setItem('path',path);
localStorage.setItem('name',name);
localStorage.setItem('file_id',file_id);
if(3 == e.which){
e.preventDefault();
var offsetLeft = e.pageX;
var offsetTop = e.pageY;
var tipStyle = 'top:'+offsetTop+'px;left:'+offsetLeft+'px;';
$('#file_action').hide();
$('#folder_action').hide();
if($('#file_action').css('display') == 'none'){
$('#file_action').attr('style',tipStyle).show();
}else{
$('#file_action').hide();
}
}
});
现在我就是全局屏蔽。。
$(document).bind('contextmenu',function(){
return false;
});
$('.file_list').mousedown(function(e){
//代码。。。。。
}).bind('contextmenu',function(e){
e.preventDefault();
return false;
});