Js+DVML:很酷实用的右键弹出菜单
生活随笔
收集整理的這篇文章主要介紹了
Js+DVML:很酷实用的右键弹出菜单
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
<HTML?xmlns:v><HEAD>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312">
<title>網頁特效|wuym.com|---Js+DVML:很酷實用的右鍵彈出菜單</title>
<STYLE>
v\:*{behavior:url(#default#VML);}
.menulist{position:static;PADDING-TOP:6;LETTER-SPACING:8;HEIGHT:20;TEXT-ALIGN:center;margin-bottom:-2}
</STYLE>
</head>
<BODY?oncontextmenu='return?false'>
<Script>
//作者:風云舞
var?menutime1=null,showobjs1=null??//menutime1=循環計時器調用變量,showobjs1=綁定菜單,定時器過程執行時調用
function?document.onmouseup(){if(event.button==2)menushow(menu2,60,10)}
function?menushow(showobjs,showwid,showsudu){??//右鍵菜單展開函數
?//函數說明:menushow(菜單id,項平均寬度,伸展速度)
if(menutime1!=null){clearInterval(menutime1);menutime1=null}
showobjs.style.left=event.x;showobjs.style.top=event.y;
showobjs1=showobjs.all.tags("roundrect");var?showlens=showobjs1.length
for(i=0;i<showlens;i++){showobjs1[i].style.width=0;showobjs1[i].style.visibility="hidden"}
showobjs.style.display=""
menutime1=setInterval("for(i=0;i<"+showlens+";i++){showobjs1[i].style.visibility='';if(showobjs1[i].offsetWidth<"+showwid+"){showobjs1[i].style.width=showobjs1[i].offsetWidth+"+showsudu+";break;}else{if(i=="+(showlens-1)+"){clearInterval(menutime1);menutime1=null}}}",20)
}
function?menuclose(showobjs2,showsudu2){??//右鍵菜單關閉函數
?//函數說明:menushow(菜單id,關閉壓縮速度)
if(menutime1!=null)return?false
showobjs1=showobjs2.all.tags("roundrect");var?showlens=showobjs1.length-1
menutime1=setInterval("for(i="+showlens+";i>-1;i--){if(showobjs1[i].offsetWidth>0){try{showobjs1[i].style.width=showobjs1[i].offsetWidth-"+showsudu2+";break;}catch(e){showobjs1[i].style.visibility='hidden';if(i==0){clearInterval(menutime1);menutime1=null}}}}",20)
}
</script>
<span?id=menu2?style="position:absolute;Z-INDEX:40000;LEFT:395;TOP:210;color:#739EFE;cursor:hand;display:none;font-size:12px;font-family:宋體"?onmouseover="if(event.srcElement.tagName=='roundrect'){event.srcElement.strokecolor='blue';event.srcElement.style.color='blue';event.srcElement.style.marginLeft=10}"?onmouseout="if(event.srcElement.tagName=='roundrect'){event.srcElement.strokecolor='#739EFE';event.srcElement.style.color='#739EFE';event.srcElement.style.marginLeft=0}">
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/><a?target=_blank?href=http://jscode.cn>網格</a></v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>矩陣</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>分界線</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>刷新</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>設置</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項.</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項..</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE?onmouseup="menuclose(menu2,30)">
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>取消</v:roundrect>
</span>
</body>
</html>
<head>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312">
<title>網頁特效|wuym.com|---Js+DVML:很酷實用的右鍵彈出菜單</title>
<STYLE>
v\:*{behavior:url(#default#VML);}
.menulist{position:static;PADDING-TOP:6;LETTER-SPACING:8;HEIGHT:20;TEXT-ALIGN:center;margin-bottom:-2}
</STYLE>
</head>
<BODY?oncontextmenu='return?false'>
<Script>
//作者:風云舞
var?menutime1=null,showobjs1=null??//menutime1=循環計時器調用變量,showobjs1=綁定菜單,定時器過程執行時調用
function?document.onmouseup(){if(event.button==2)menushow(menu2,60,10)}
function?menushow(showobjs,showwid,showsudu){??//右鍵菜單展開函數
?//函數說明:menushow(菜單id,項平均寬度,伸展速度)
if(menutime1!=null){clearInterval(menutime1);menutime1=null}
showobjs.style.left=event.x;showobjs.style.top=event.y;
showobjs1=showobjs.all.tags("roundrect");var?showlens=showobjs1.length
for(i=0;i<showlens;i++){showobjs1[i].style.width=0;showobjs1[i].style.visibility="hidden"}
showobjs.style.display=""
menutime1=setInterval("for(i=0;i<"+showlens+";i++){showobjs1[i].style.visibility='';if(showobjs1[i].offsetWidth<"+showwid+"){showobjs1[i].style.width=showobjs1[i].offsetWidth+"+showsudu+";break;}else{if(i=="+(showlens-1)+"){clearInterval(menutime1);menutime1=null}}}",20)
}
function?menuclose(showobjs2,showsudu2){??//右鍵菜單關閉函數
?//函數說明:menushow(菜單id,關閉壓縮速度)
if(menutime1!=null)return?false
showobjs1=showobjs2.all.tags("roundrect");var?showlens=showobjs1.length-1
menutime1=setInterval("for(i="+showlens+";i>-1;i--){if(showobjs1[i].offsetWidth>0){try{showobjs1[i].style.width=showobjs1[i].offsetWidth-"+showsudu2+";break;}catch(e){showobjs1[i].style.visibility='hidden';if(i==0){clearInterval(menutime1);menutime1=null}}}}",20)
}
</script>
<span?id=menu2?style="position:absolute;Z-INDEX:40000;LEFT:395;TOP:210;color:#739EFE;cursor:hand;display:none;font-size:12px;font-family:宋體"?onmouseover="if(event.srcElement.tagName=='roundrect'){event.srcElement.strokecolor='blue';event.srcElement.style.color='blue';event.srcElement.style.marginLeft=10}"?onmouseout="if(event.srcElement.tagName=='roundrect'){event.srcElement.strokecolor='#739EFE';event.srcElement.style.color='#739EFE';event.srcElement.style.marginLeft=0}">
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/><a?target=_blank?href=http://jscode.cn>網格</a></v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>矩陣</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>分界線</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>刷新</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>設置</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項.</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項..</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE>
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>項</v:roundrect><br>
<v:roundrect?class=menulist?arcsize=0.5?strokecolor=#739EFE?onmouseup="menuclose(menu2,30)">
<v:fill?type=gradient?opacity=.4?color=#739EFE?color2=white?angle="50"/>取消</v:roundrect>
</span>
</body>
</html>
轉載于:https://www.cnblogs.com/zbqy/archive/2007/04/14/712793.html
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的Js+DVML:很酷实用的右键弹出菜单的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于SOA的体系架构设计
- 下一篇: 面试算法题6