码迷,mamicode.com
首页 > 其他好文 > 详细

屏蔽右键菜单

时间:2014-11-06 17:41:11      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:js

document.oncontextmenu = function (event){
	if(window.event){
		event = window.event;
	}try{
		var the = event.srcElement;
		if (!((the.tagName == "INPUT" && the.type.toLowerCase() == "text") || the.tagName == "TEXTAREA")){
			return false;
		}
		return true;
	}catch (e){
		return false; 
	} 
}

屏蔽右键菜单

标签:js

原文地址:http://blog.csdn.net/wenjin1204/article/details/40862005

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!