| 点击阅读全文看看,你能不能复制?学会几个小技巧将会保护你的文章..........(当然这只是雕虫小技而已,对于高手而言仍可以破解....)
<DIV id=divTitle style="FONT-SIZE: 16px">禁止复制代码1</DIV> < LANGUAGE=java> click() { alert('禁止你的左键复制!') } click1() { if (event.button==2) {alert('禁止右键点击~!') }} CtrlKeyDown(){ if (event.ctrlKey) {alert('不当的拷贝将损害您的系统!') }} down=CtrlKeyDown; onselectstart=click; down=click1; </>
< language=java></> <DIV id=divTitle style="FONT-SIZE: 16px">禁止复制代码2</DIV> < language="Java" type="text/Java"> <!-- MM_reloadPage(init) { //reloads the window if Nav4 resized if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) { MM_pgW=innerWidth; MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=MM_pgW || innerHeight!=MM_pgH) location.reload(); } MM_reloadPage(true); //--> </> </head> <body leftmargin=0 topmargin=0 move='HideMenu()' oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="selection.empty()" oncopy="selection.empty()" onbeforecopy="return false" up="selection.empty()"> <no><i src="http://blog.eduol.cn/*>";</i></no>
// 彻底屏蔽右键菜单 oncontextmenu = () { event.return=false; alert("对话框内容"); return false; }
禁止网页内容复制.粘贴:在<body>中加入以下代码: <body move=\HideMenu()\ oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="selection.empty()" oncopy="selection.empty()" onbeforecopy="return false" up="selection.empty()">
一个更简单的方法就是在<body>中加入如下的代码,这样鼠标的左右键都失效了.
topmargin="0" oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="selection.empty()" oncopy="selection.empty()" onbeforecopy="return false" up="selection.empty()"
具体步骤参照上篇文章"个性鼠标的设计"
|