日本黄色片在线视频|国模无码一区二区三区|大香伊蕉国产短视频69|99精品日韩欧美在线观看|极品夜晚无码av一区二区|亚洲综合无码一区二区三区|国产亚洲精aa在线观看香蕉|日本2018一道国产高清视频

當(dāng)前位置:首頁(yè) > 長(zhǎng)沙網(wǎng)站建設(shè) > 鼠標(biāo)右鍵彈出式菜單

鼠標(biāo)右鍵彈出式菜單

<html>
<head>
<STYLE>
.menutable {
 BORDER-RIGHT: #307ce8 1px solid; BORDER-TOP: #94bcf3 1px solid; FONT-SIZE: 12px; Z-INDEX: 100; BORDER-LEFT: #307ce8 5px solid; BORDER-BOTTOM: #307ce8 1px solid; POSITION: absolute; BACKGROUND-COLOR: #ffffff
}
.menutrin {
 CURSOR: hand; COLOR: #ffffff; BACKGROUND-COLOR: #1a71e6
}
.menutrout {
 CURSOR: hand; COLOR: #000000
}
.menutd0 {
 WIDTH: 28px; HEIGHT: 25px; TEXT-ALIGN: center; 改變這個(gè)修改菜單高度---:
}
.menutd1 {
 WIDTH: 46px; FONT-FAMILY: Webdings; TEXT-ALIGN: right
}
.linktd1 {
 WIDTH: 46px
}
.menutd2 {
 WIDTH: 4px
}
.menuhr {
 BORDER-RIGHT: #307ce8 1px inset; BORDER-TOP: #307ce8 1px inset; BORDER-LEFT: #307ce8 1px inset; BORDER-BOTTOM: #307ce8 1px inset
}
</STYLE>
<BGSOUND id=theBS src="" loop=0>
</head>
<body>
<center>點(diǎn)擊右鍵試試</center>
<script>
<!----

/*-----------------------------------------------------------
鼠標(biāo)右鍵菜單 1.0 Designed By Stroll  e-mail: csy-163@163.com

 

--------------------------------------------------------------*/

//---------------  有關(guān)數(shù)據(jù) -----------------//

var IconList = new Array();   // icon圖片 集合, 下標(biāo)從 1 開(kāi)始

 IconList[1] = new Image();
 
 IconList[1].src = "http://www.aspjz.com/images/jinhuabiao.gif";
 
 IconList[2] = new Image();
 
 IconList[2].src = "http://www.aspjz.com/images/jinhuabiao.gif";

 IconList[3] = new Image();
 
 IconList[3].src = "http://www.aspjz.com/images/jinhuabiao.gif";
 
 IconList[4] = new Image();
 
 IconList[4].src = "http://www.aspjz.com/images/jinhuabiao.gif";

//----------------  檢測(cè)變量 菜單的顯示隱藏就靠它了?。。?nbsp; ------------------//

var JustMenuID = "";

var SubMenuList = new Array();

var NowSubMenu = "";

var mouseCanSound = true;   //---------------------------  聲音開(kāi)關(guān) ------  聲音開(kāi)關(guān) ------------------//

var menuSpeed     =  50;   //---------- 菜單顯示速度 ------------//

var alphaStep     =  30;   //---------- Alpaha 變化 度 -----------//
 
//------------- 構(gòu)建 主菜單 對(duì)象 -------------//

function MouseMenu(objName)
{
 this.id    = "Menu_"+objName;
 this.obj   = objName;
 this.length  = 0;
 
 
 this.addMenu = addMenu;
 this.addLink = addLink;
 this.addHR   = addHR;
 
 JustMenuID = this.id;
 
 document.body.insertAdjacentHTML('beforeEnd','<table id="'+this.id+'" border="0" cellspacing="0" cellpadding="0" style="top: 0; left: 0; visibility: hidden; filter:Alpha(Opacity=0);" class="menutable" onmousedown=event.cancelBubble=true; onmouseup=event.cancelBubble=true></table>');
}

//----------- 構(gòu)建 子菜單 對(duì)象 -------------//

function SubMenu(objName,objID)
{
 this.obj = objName;
 this.id  = objID;

 this.addMenu = addMenu;
 this.addLink = addLink;
 this.addHR   = addHR;

 this.length  = 0;
}


//-------------- 生成 菜單 makeMenu 方法 -----------//
function makeMenu(subID,oldID,word,icon,url,target,thetitle)
{
 var thelink = '';
 

 if(icon&&icon!="")
 {
  icon = '<img border="0" src="'+IconList[icon].src+'">';
 }
 else
 {
  icon = '';
 }
 
 if(!thetitle||thetitle=="")
 {
  thetitle = '';
 }
 
 
 if(url&&url!="")
 {
  thelink += '<a href="'+url+'" ';
 
  if(target&&target!="")
  {
   thelink += ' 
   thelink += 'target="'+target+'" '
  }
 
  thelink += '></a>';
 }
 
 var Oobj = document.getElementById(oldID);

 /*--------------------------------------------- 菜單html樣式
 
   <tr class="menutrout" id="trMenu_one_0" title="I am title">
      <td class="menutd0"><img src="icon/sub.gif" border="0" width="16" height="16"></td>
      <td><a href="javascript:alert('I am menu');" target="_self"></a><nobr>菜單一</nobr></td>
      <td class="menutd1">4</td>
      <td class="menutd2"> </td>
    </tr>

 
 --------------------------------------------------*/
 
 Oobj.insertRow();
 

 with(Oobj.rows(Oobj.rows.length-1))
 {
  id    = "tr"+subID;
  className = "menutrout";
 
  title       = thetitle;

 }
 
 eventObj = "tr"+subID;
 
 eval(eventObj+'.attachEvent("onmouseover",MtrOver('+eventObj+'))');
 eval(eventObj+'.attachEvent("onclick",MtrClick('+eventObj+'))');
 
 var trObj = eval(eventObj);

 for(i=0;i<4;i++)
 {
  trObj.insertCell();
 }

 with(Oobj.rows(Oobj.rows.length-1))
 {
  cells(0).className = "menutd0";
  cells(0).innerHTML = icon;

  cells(1).innerHTML = thelink+'<nobr class=indentWord>'+word+'</nobr>';
  cells(1).calssName = "indentWord"
 
  cells(2).className = "menutd1";
  cells(2).innerHTML = "4";
 
  cells(3).className = "menutd2";
  cells(3).innerText = " ";
 
 }
 
 
 
 document.body.insertAdjacentHTML('beforeEnd','<table id="'+subID+'" border="0" cellspacing="0" cellpadding="0" style="top: 0; left: 0; visibility: hidden; filter:Alpha(Opacity=0);" class="menutable" onmousedown=event.cancelBubble=true; onmouseup=event.cancelBubble=true></table>');
 
 
 
}


//---------------- 生成連接 makeLink 方法 ------------//
function makeLink(subID,oldID,word,icon,url,target,thetitle)
{
 
 
 var thelink = '';
 
 if(icon&&icon!="")
 {
  icon = '<img border="0" src="'+IconList[icon].src+'">';
 }
 else
 {
  icon = '';
 }
 
 if(!thetitle||thetitle=="")
 {
  thetitle = '';
 }
 
 
 if(url&&url!="")
 {
  thelink += '<a href="'+url+'" ';
 
  if(target&&target!="")
  {
   thelink += '  ';
   thelink += 'target="'+target+'" '
  }
 
  thelink += '></a>';
 }
 
 var Oobj = document.getElementById(oldID);
 
 
 /*--------------------------------------------- 連接html樣式
 
   <tr class="menutrout" id="trMenu_one_0" title="I am title">
      <td class="menutd0"><img src="icon/sub.gif" border="0" width="16" height="16"></td>
      <td><a href="javascript:alert('I am link');" target="_self"></a><nobr>連接一</nobr></td>
      <td class="linktd1"></td>
      <td class="menutd2"> </td>
    </tr>

 
 --------------------------------------------------*/
 
 Oobj.insertRow();
 

 with(Oobj.rows(Oobj.rows.length-1))
 {
  id    = "tr"+subID;
  className = "menutrout"; 
  title       = thetitle;

 }
 
 eventObj = "tr"+subID;
 
 eval(eventObj+'.attachEvent("onmouseover",LtrOver('+eventObj+'))');
 eval(eventObj+'.attachEvent("onmouseout",LtrOut('+eventObj+'))'); 
 eval(eventObj+'.attachEvent("onclick",MtrClick('+eventObj+'))');
 
 var trObj = eval(eventObj);

 for(i=0;i<4;i++)
 {
  trObj.insertCell();
 }

 with(Oobj.rows(Oobj.rows.length-1))
 {
  cells(0).className = "menutd0";
  cells(0).innerHTML = icon;

  cells(1).innerHTML = thelink+'<nobr class=indentWord>'+word+'</nobr>';

  cells(2).className = "linktd1";
  cells(2).innerText = " ";
 
  cells(3).className = "menutd2";
  cells(3).innerText = " ";
 
 }

}


//-------------- 菜單對(duì)象 addMenu 方法 ------------//
function addMenu(word,icon,url,target,title)
{
 var subID    = this.id + "_" + this.length;
 var subObj  = this.obj+"["+this.length+"]";
 
 var oldID   = this.id;
 
 eval(subObj+"= new SubMenu('"+subObj+"','"+subID+"')");
 
  makeMenu(subID,oldID,word,icon,url,target,title);
 
  this.length++;
 
}


//------------- 菜單對(duì)象 addLink 方法 -------------//
function addLink(word,icon,url,target,title)
{
 var subID    = this.id + "_" + this.length;
 var oldID  = this.id;
 
  makeLink(subID,oldID,word,icon,url,target,title);
 
  this.length++;
}

//------------ 菜單對(duì)象 addHR 方法 -----------------//
function addHR()
{
 var oldID = this.id;

 var Oobj = document.getElementById(oldID);
 
 Oobj.insertRow();
 
 /*------------------------------------------
 
  <tr>
      <td colspan="4">
  <hr class="menuhr" size="1" width="95%">
       </td>
    </tr>
 
 --------------------------------------------*/

 
 Oobj.rows(Oobj.rows.length-1).insertCell();

 with(Oobj.rows(Oobj.rows.length-1))
 {
  cells(0).colSpan= 4;
  cells(0).insertAdjacentHTML('beforeEnd','<hr class="menuhr" size="1" width="95%">'); 
 }
 
}

 

 


//--------- MtrOver(obj)-------------------//
function MtrOver(obj)
{
 return sub_over;
 
 function sub_over()
 {
 
  var sonid = obj.id.substring(2,obj.id.length);
 
  var topobj = obj.parentElement.parentElement;
 
  NowSubMenu = topobj.id;
 
  if(obj.className=="menutrout")
  {
   mouseWave();
  } 
 
  HideMenu(1); 
 
  SubMenuList[returnIndex(NowSubMenu)] = NowSubMenu;

  ShowTheMenu(sonid,MPreturn(sonid)) 
 
  SubMenuList[returnIndex(obj.id)] = sonid;
 
  if(topobj.oldTR)
  {
   eval(topobj.oldTR+'.className = "menutrout"');
  }

  obj.className = "menutrin";

  topobj.oldTR = obj.id;
 

 }
}

//--------- LtrOver(obj)-------------------//
function LtrOver(obj)
{
 return sub_over;
 
 function sub_over()
 {
  var topobj = obj.parentElement.parentElement;

  NowSubMenu = topobj.id;
 
  HideMenu(1);
 
  SubMenuList[returnIndex(NowSubMenu)] = NowSubMenu;
   
  if(topobj.oldTR)
  {
   eval(topobj.oldTR+'.className = "menutrout"');
  }

  obj.className = "menutrin";

  topobj.oldTR = obj.id;

 }
}

//--------- LtrOut(obj)-------------------//
function LtrOut(obj)
{
 return sub_out;
 
 function sub_out()
 {
  var topobj = obj.parentElement.parentElement;
 
  obj.className = "menutrout";
 
  topobj.oldTR = false;
 }
}

//----------MtrClick(obj)-----------------//

function MtrClick(obj)
{
 return sub_click;
 
 function sub_click()
 {
  if(obj.cells(1).all.tags("A").length>0)
  {
   obj.cells(1).all.tags("A")(0).click();
  }

 }
}


//---------- returnIndex(str)--------------//

function returnIndex(str)
{
 return (str.split("_").length-3)
}


//---------ShowTheMenu(obj,num)-----------------//

function ShowTheMenu(obj,num)
{
 var topobj = eval(obj.substring(0,obj.length-2));
 
 var trobj  = eval("tr"+obj);
 
 var obj = eval(obj);
 
 if(num==0)
 {
  with(obj.style)
  {
   pixelLeft = topobj.style.pixelLeft +topobj.offsetWidth;
   pixelTop  = topobj.style.pixelTop + trobj.offsetTop;
  }
 }
 if(num==1)
 {
  with(obj.style)
  {
   pixelLeft = topobj.style.pixelLeft + topobj.offsetWidth;
   pixelTop  = topobj.style.pixelTop  + trobj.offsetTop + trobj.offsetHeight - obj.offsetHeight;
  }
 }
 if(num==2)
 {
  with(obj.style)
  {
   pixelLeft = topobj.style.pixelLeft -  obj.offsetWidth;
   pixelTop  = topobj.style.pixelTop + trobj.offsetTop;
  }
 }
 if(num==3)
 {
  with(obj.style)
  {
   pixelLeft = topobj.style.pixelLeft -  obj.offsetWidth;
   pixelTop  = topobj.style.pixelTop  + trobj.offsetTop + trobj.offsetHeight - obj.offsetHeight;
  }
 }
 
 obj.style.visibility  = "visible"; 
 
 if(obj.alphaing)
 {
  clearInterval(obj.alphaing);
 }
 
 obj.alphaing = setInterval("menu_alpha_up("+obj.id+","+alphaStep+")",menuSpeed);
}

//----------HideMenu(num)-------------------//

/*----------------------
var SubMenuList = new Array();

var NowSubMenu = "";

---------------------*/

function HideMenu(num)
{
 var thenowMenu = "";
 
 var obj = null;
 
 if(num==1)
 {
  thenowMenu = NowSubMenu
 }
 
 
 
 for(i=SubMenuList.length-1;i>=0;i--)
 {
  if(SubMenuList[i]&&SubMenuList[i]!=thenowMenu)
  {
  
   obj = eval(SubMenuList[i]);
  
   if(obj.alphaing)
   {
    clearInterval(obj.alphaing);
   }

   obj.alphaing = setInterval("menu_alpha_down("+obj.id+","+alphaStep+")",menuSpeed);
  
   obj.style.visibility = "hidden"; 
  
   eval("tr"+SubMenuList[i]).className = "menutrout";
     
   SubMenuList[i] = null;
  }
  else
  {
   if(SubMenuList[i]==thenowMenu)
   {
    return;
   }
  }
 }
 
 NowSubMenu = "";
}

 


//-----------MainMenuPosition return()------------//

function MMPreturn()
{
 var obj = eval(JustMenuID);
 
 var x = event.clientX;

 var y = event.clientY;
 
 var judgerX = x + obj.offsetWidth;
 var judgerY = y + obj.offsetHeight;

 var px = 0;
 var py = 0;
 
 if(judgerX>document.body.clientWidth)
 {
  px = 2;
 }
 if(judgerY>document.body.clientHeight)
 {
  py = 1;
 }
 
 return (px+py);
}

//-----------MenuPosition return(obj)--------------//

function MPreturn(obj)
{
 var topobj = eval(obj.substring(0,obj.length-2));
 
 var trobj  = eval("tr"+obj);
 
 var x = topobj.style.pixelLeft + topobj.offsetWidth;
 var y = topobj.style.pixelTop  + trobj.offsetTop;

 obj = eval(obj);
 
 var judgerY =  obj.offsetHeight + y;
 var judgerX =  obj.offsetWidth  + x;
 
 var py = 0;
 var px = 0;
 
 if(judgerY>=document.body.clientHeight)
 {
  py = 1;
 }
 
 if(judgerX>= document.body.clientWidth)
 {
  px = 2;
 }
  
 return (px+py);
}

//-----------mouseWave()-------------//

function mouseWave()
{
 if(mouseCanSound)
 {
  theBS.src= "upfiles/sound.wav";
 }
}

//----------- menu_alpha_down -------//

function menu_alpha_down(obj,num)
{
  var obj = eval(obj);
 
  if(obj.filters.Alpha.Opacity > 0 )
  {
   obj.filters.Alpha.Opacity += -num;
  }
  else
  {
   clearInterval(obj.alphaing);
   obj.filters.Alpha.Opacity = 0;
   obj.alphaing = false;  
   obj.style.visibility = "hidden";
  }
}


//------------ menu_alpha_up --------//

function menu_alpha_up(obj,num)
{
  var obj = eval(obj);
 
  if(obj.filters.Alpha.Opacity<100)
   obj.filters.Alpha.Opacity += num;
  else
  {
   clearInterval(obj.alphaing);
   obj.filters.Alpha.Opacity = 100;
   obj.alphaing = false;
  }
}


//----------- IE ContextMenu -----------------//

function document.oncontextmenu()
{
 return false;
}


//----------- IE Mouseup ----------------//

function document.onmouseup()
{
 if(event.button==2)
 {
 
  HideMenu(0);
 

  var obj = eval(JustMenuID)
 
 
   obj.style.visibility = "hidden";
  
  
   if(obj.alphaing)
   {
    clearInterval(obj.alphaing);
   }
  
   obj.filters.Alpha.Opacity = 0;
  
   var judger = MMPreturn()
  
   if(judger==0)
   {
    with(obj.style)
    {
     pixelLeft = event.clientX + document.body.scrollLeft;
     pixelTop  = event.clientY + document.body.scrollTop;
    }
   }
   if(judger==1)
   {
    with(obj.style)
    {
     pixelLeft = event.clientX + document.body.scrollLeft;
     pixelTop  = event.clientY - obj.offsetHeight + document.body.scrollTop;
    }
   }
   if(judger==2)
   {
    with(obj.style)
    {
     pixelLeft = event.clientX - obj.offsetWidth + document.body.scrollLeft;
     pixelTop  = event.clientY + document.body.scrollTop;
    }
   }
   if(judger==3)
   {
    with(obj.style)
    {
     pixelLeft = event.clientX - obj.offsetWidth + document.body.scrollLeft;
     pixelTop  = event.clientY - obj.offsetHeight + document.body.scrollTop;
    }
   }
  
   mouseWave();
     
   obj.style.visibility = "visible";
  
   obj.alphaing = setInterval("menu_alpha_up("+obj.id+","+alphaStep+")",menuSpeed);

 
 
 }
}

//---------- IE MouseDown --------------//

function document.onmousedown()
{
 if(event.button==1)
 {
  HideMenu();
 
  var obj = eval(JustMenuID)
 
  if(obj.alphaing)
  {
   clearInterval(obj.alphaing);
  }
 
  obj.alphaing = setInterval("menu_alpha_down("+obj.id+","+alphaStep+")",menuSpeed);
 
 }
}
//----->


 var one = new MouseMenu("one");
 
 one.addMenu("菜單一",1,"javascript:alert('I am menu');","_self","I am title");
  one[0].addLink("連接一",2,"javascript:alert('I am link')")
  one[0].addHR()
  one[0].addLink("連接二","","javascript:alert('I am link')") 
  one[0].addMenu("菜單三");
   one[0][one[0].length-1].addLink("連接一",1,"javascript:;")
  one[0].addLink("連接三","","javascript:alert('I am link')")
  one[0].addLink("連接四","","javascript:alert('I am link')")
 one.addLink("連接二","","javascript:alert('I am link')")
 one.addMenu("菜單二",3);
  one[2].addLink("連接一","","javascript:alert('I am link')")
 one.addHR();
 one.addLink("連接三,多長(zhǎng)都可以",4,"javascript:alert('I am link')")
 one.addHR();
 one.addLink("網(wǎng)頁(yè)天使收集",4,"javascript:alert('為你獻(xiàn)上最好的javascript腳本')")
 

</script>
</body>
</html>

發(fā)表評(píng)論
◎歡迎參與討論,請(qǐng)?jiān)谶@里發(fā)表您的看法、交流您的觀點(diǎn)。

相關(guān)文章

2021年優(yōu)度成功簽約并完成泰坦凝膠官網(wǎng)

2021年優(yōu)度成功簽約并完成泰坦凝膠官網(wǎng)

此網(wǎng)站采用標(biāo)準(zhǔn)網(wǎng)站建設(shè)方案,PC+移動(dòng)自動(dòng)轉(zhuǎn)換模式,網(wǎng)站產(chǎn)品為一款火爆的微商產(chǎn)品,也是一款男性用品。...

備案與沒(méi)備案的新網(wǎng)站老域名為什么百度都不收錄?

備案與沒(méi)備案的新網(wǎng)站老域名為什么百度都不收錄?

現(xiàn)在互聯(lián)網(wǎng)越來(lái)越難做,百度的門檻越來(lái)越高,以前新網(wǎng)站上線提交后3天就會(huì)收錄,現(xiàn)在新網(wǎng)站上線每天提交還不一定會(huì)收錄,必須結(jié)合外鏈才有效。...

做好“著陸頁(yè)”,公司銷售業(yè)績(jī)將提升一大步

做好“著陸頁(yè)”,公司銷售業(yè)績(jī)將提升一大步

當(dāng)今,一個(gè)能在用戶尋找“返回”按鈕之前抓住用戶眼球的著陸頁(yè)比以往任何時(shí)候都更有商業(yè)價(jià)值。值得慶幸的是,一個(gè)好的著陸頁(yè)面的設(shè)計(jì)過(guò)程比以往更加容易把握,訣竅在于弄清楚實(shí)現(xiàn)這個(gè)非常重要的切入點(diǎn)所需的核心要素...

什么是關(guān)鍵詞?

什么是關(guān)鍵詞?

關(guān)鍵詞就是你向搜索引擎發(fā)出的一個(gè)指令,是讓搜索引擎幫助你查找相關(guān)信息的命令,它可以是一個(gè)字,也可以是一個(gè)詞、一句話、一個(gè)英字母、英文單詞、一個(gè)數(shù)字、一個(gè)符號(hào)等任何可以在搜索框中輸入的信息。...

什么樣的網(wǎng)站才是一個(gè)合格的SEO網(wǎng)站?

什么樣的網(wǎng)站才是一個(gè)合格的SEO網(wǎng)站?

在講網(wǎng)站之前還是來(lái)介紹一下什么是網(wǎng)站,因?yàn)檫@里的學(xué)員還有很多SEO初學(xué)者,網(wǎng)站就好比是我們?cè)谀硞€(gè)商場(chǎng)、某個(gè)小區(qū)開(kāi)的一個(gè)店鋪,你做生意肯定是有一個(gè)店鋪的對(duì)吧,那么網(wǎng)站就是一個(gè)互聯(lián)網(wǎng)上的店鋪,是一個(gè)虛擬的...