<div class="htmlarea"> <textarea id="runcode85720"> <title>禁止在图片上使用右键</title> <script language="JavaScript1.2"> var clickmessage="无法完成操作!" function disableclick(e) { if (document.all) { if (event.button==2||event.button==3) { if (event.srcElement.tagName=="IMG"){ alert(clickmessage); return false; } } } if (document.layers) { if (e.which == 3) { alert(clickmessage); return false; } } } function associateimages(){ for(i=0;i<document.images.length;i++) document.images[i].onmousedown=disableclick; } if (document.all) document.onmousedown=disableclick else if (document.layers) associateimages() </script> <img src="/images/logo.gif" alt="禁止在图片上使用右键_图象特效" > </textarea><br><input onclick="runEx('runcode85720')" type="button" value="运行代码"> <input onclick="doCopy('runcode85720')" type="button" value="复制代码"> <input onclick="doSave(runcode85720)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div>