关于我们 广告服务 社区论坛
设为首页 加入收藏

行业新闻
服 务 器
模版下载
建站指南
冲浪宝典
办公软件
网站运营
操作系统
QQ 专题
网页制作
安全防御
视频教程
网络编程
SEO专区
软件下载
图像设计
Cisco
网页特效
Wap 技术
联盟赚钱
网页素材
 首页 | 企业建站 | 网页制作 | 网站运营 | 网络编程 | 图像设计 | 冲浪宝典 | 操作系统 | SEO专区 | 联盟赚钱 | Cisco

欢迎来到e天下网络首页>>网页制作>>Html>>正文|网页中取消鼠标右键方法大全

网页中取消鼠标右键方法大全

[ 来路:21kn.com    时间:2007-7-7 17:08:43    点击: ]

 

第一种:最笨的方法
把下列代码加入到<head>与</head>之间 
<SCRIPT language=javascript>
  function click() {
  if (event.button==2) {
  alert('欢迎访问把握时间http://www.85time.com')
  }
  }
  document.onmousedown=click
  </SCRIPT> 

第二种:添加至收藏夹
<SCRIPT language=JavaScript><!--
function click() {
if (event.button==2) 

{window.external.addFavorite('http://www.85time.com','把握时间咨询网站

')}}
document.onmousedown=click
// --></SCRIPT>

第三种:使鼠标右键无响应,别人还以为自己的鼠标坏了!
把<BODY>改成<BODY oncontextmenu=self.event.returnValue=false>

第四种:最聪明的方法,自己定制鼠标的右键菜单,给访问者以全新的感受!
第一步:把代码加入到<head>与</head>之间 
<style> 
<!-- 
/* 
Context menu Script- 
c Dynamic Drive 
Last updated: 99/09/16th 
For full source code, 100's more DHTML scripts, and Terms Of Use, 
visit dynamicdrive.com 
*/ 
#ie5menu{ 
position:absolute; 
width:200px; 
border:2px solid black; 
background-color:menu; 
font-family:Verdana; 
line-height:20px; 
cursor:default; 
visibility:hidden; 

.menuitems{ 
padding-left:15px; 
padding-right:15px; 

--> 
</style> 
<script language="JavaScript1.2"> 
//set this variable to 1 if you wish the URLs of the highlighted menu 

to be displayed in the status bar 
var display_url=0 
function showmenuie5(){ 
var rightedge=document.body.clientWidth-event.clientX 
var bottomedge=document.body.clientHeight-event.clientY 
if (rightedge<ie5menu.offsetWidth) 
ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offse

tWidth 
else 
ie5menu.style.left=document.body.scrollLeft+event.clientX 
if (bottomedge>ie5menu.offsetHeight) 
ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetH

eight 
else 
ie5menu.style.top=document.body.scrollTop+event.clientY 
ie5menu.style.visibility="visible" 
return false 

function hidemenuie5(){ 
ie5menu.style.visibility="hidden" 

function highlightie5(){ 
if (event.srcElement.className=="menuitems"){ 
event.srcElement.style.backgroundColor="highlight" 
event.srcElement.style.color="white" 
if (display_url==1) 
window.status=event.srcElement.url 


function lowlightie5(){ 
if (event.srcElement.className=="menuitems"){ 
event.srcElement.style.backgroundColor="" 
event.srcElement.style.color="black" 
window.status=' 


function jumptoie5(){ 
if (event.srcElement.className=="menuitems") 
window.location=event.srcElement.url 

</script> 
第二步:把下列代码加入到<body>与</body>之间
<!--[if IE]> 
<div id="ie5menu" onMouseover="highlightie5()" 

onMouseout="lowlightie5()" onClick="jumptoie5()"> 
<div class="menuitems" url="http://www.85time.com">85time网站首页</div> 
<div class="menuitems" 

url="http://www.85time.com/85time/index.php">85time技术论坛</div> 
<div class="menuitems" url="http://www.85time.com/mydowns.htm">85time软

件下载</div> 
<div class="menuitems" 

url="http://mydowns.oso.com.cn/chat/index.php">85time聊天室</div> 
<div class="menuitems" 

url="http://www.85time.com/source/85timegb/index.php">85time留言板

</div> 
<hr> 
<div class="menuitems" url="http://www.85time.com">把握时间咨询网站

</div> 
</div> 
<![endif]--> 
<script language="JavaScript1.2"> 
document.oncontextmenu=showmenuie5 
if (document.all&&window.print) 
document.body.onclick=hidemenuie5 
</script>

以上资料是我自己收集积累起来的,现拿出来与各位共享,有更好的方法别忘了
通知我一声!当然,你也可以不用取消鼠标右键,就看你自己的需要了! 

::::站长友情提示:多花一分钟学点什么都好::::

 

上一篇:页面特效之--夜晚的星空  下一篇:在网页中制作动态时间按钮

 ::热点信息::

 

= = 免责声明 = =

① 欢迎转载我网所刊信息,请注明“来源:E天下网络”。
② 凡本网注明“来源:XXX(非E天下网络)”的作品,均转载自其它媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。如因作品内容、版权和其它问题需要同本网联系的,请在30日内进行。
※联系方式:Airtofly@163.com

::推荐文章::

 

Dreamweaver8创建自定义代码片

::图像设计::

 

动态图片搜索家——GIF RUNN
软件搜索利器——FileFerret
实例说明构图要讲规律
Character Builder让你尽展靓
全景图速成者Cool360
三维模型速成工具——Canoma
剪贴专家SmartBoard 32
新世纪的图像处理利器——Ph
更多内容..

 

 

关于我们 广告服务 友情链接 合作伙伴 社区论坛 免责声明

Copyright © 2007   21kn.com Inc. All rights reserved.e天下网络工作室

网站白天客服QQ:26875416 (非24小时)  合作QQ:597004688    粤ICP备06026423号