禁止鼠标右键跳转代码

时间:2013-12-4 11:20  作者:也木  来源:本站原创  查看:2566  评论:0



<!--禁止鼠标右键跳转代码-->

<script language="JavaScript">

if (navigator.appName.indexOf("Internet Explorer") != -1)    

   document.onmousedown = noSourceExplorer;


function noSourceExplorer()


{


   if (event.button == 2 | event.button == 3)


   {


       alert("欢迎光临");


       location.replace("http://……/");


   }


}


</script>

上一篇:背景音乐代码
下一篇:复制代码
相关评论
  • 个人资料

      blogger

      也木 《青年诗人》函授班学员,中国诗歌学会会员,作品散见《诗选刊》《四川诗人》《中国组织人事报》《中国煤炭报》等报刊。曾创办民刊《诗行走》。CQyemu@qq.com

  • 日历
    随机文章