设为首页   加入最爱           最新更新:全方位英文文章资料库
 
资料坊搜索: 标题 全文     
网页中取消鼠标右键方法大全
   首页>>YesizeCOM>>电脑技能坊>>HTML>>正文       
 
广告招租,e-mail:yesize@hotmail.com

广告招租,e-mail:yesize@hotmail.com

第一种:最笨的方法
把下列代码加入到<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, 100s 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>

以上资料是我自己收集积累起来的,现拿出来与各位共享,有更好的方法别忘了
通知我一声!当然,你也可以不用取消鼠标右键,就看你自己的需要了! 
上一篇:在网页中制作动态时间按钮 下一篇:页面特效之--夜晚的星空

版权说明:作品来源于网上,版权归作者所有,如果无意中侵犯了您的版权,请来信告知,本站将在3个工作日内删除。yesize@hotmail.com
  热门小游戏分类 
射击小游戏 连连看小游戏
台球小游戏 成人小游戏
CS小游戏 化妆小游戏
赛车小游戏 休闲小游戏
篮球小游戏 换装小游戏
儿童小游戏 牛牛小游戏
麻将小游戏 冒险小游戏
美媚小游戏 益智小游戏
体育小游戏  
Society Recreation & Sports
Travel & Leisure Communications
Vehicles Computers
Fashion Arts & Entertainment
Reference & Education Disease & Illness
Writing & Speaking Politics
Product Reviews Food & Beverage
Finance Internet Business
Self Improvement Home & Family
Health & Fitness Business
最新更新内容
警惕“公务员报考热”背
公务员考试不是丈母娘考
一名新公务员的自白:我
公务员考脑筋急转弯与挂
北努斗:2006行政能力测
大讨论:06行测BT题目大
过来人回忆:当年,我也
一家之言:公务员热折射
公务员考试申论要是有正
数十万大学生走进公务员
      粤ICP备05005424         Copyright ©2000 - 2004 Yesize.COM