分类: JavaScript
2015-03-10 16:07:33
//屏蔽右键菜单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; } }//屏蔽粘贴document.onpaste = 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; } }//屏蔽复制document.oncopy = 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; } }//屏蔽剪切document.oncut = 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; } }//屏蔽选择document.onselectstart = 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; } }