window.createPopup()创建菜单

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name=ProgId content=VisualStudio.HTML>
<meta name=Originator content="Microsoft Visual Studio .NET 7.1">
</head>
<body>

<script language="javascript">
//popup标准操作
var v_popup=window.createPopup(); 
var srcDocID=null;
var srcResourceName=null;
function fn_showMenuPopup(vDocID){
   
var vSrc=event.srcElement;
   srcDocID
=vDocID;
   srcResourceName
=vSrc.parentElement.innerText;
   
var v_popupBody=v_popup.document.body;      
   v_popupBody.style.border
="2px outset #ffffff";  
   v_popupBody.innerHTML
=document.all.newMenuItemOption.innerHTML;
   
var vTags=v_popupBody.all.tags("TD");
   
for (i=0;i<vTags.length;i++)
   
{      
     vTags[i].onclick
=popup_click;
     vTags[i].onmouseover
=popup_mouseover;
     vTags[i].onmouseout
=popup_mouseout;
     vTags[i].style.cssText
="height:20;border-bottom:1 solid #CDCDCD;padding-top:3px;cursor:default";
   }

   
var vHeight=vTags.length*23+12;
   v_popup.show(vSrc.offsetWidth
+12,-35,120,vHeight,vSrc);
}

function popup_click(){
  
var vSrc =v_popup.document.parentWindow.event.srcElement;
  
if(vSrc.tagName=="IMG")vSrc=vSrc.parentElement;
  
if(srcDocID==nullreturn false;
  
switch(vSrc.id){
  
case "action_new"://新建
     new_resource();
     
break;
  
case "action_view"://查看
     window.open(path+"0/"+srcDocID+"?opendocument");
     
break;
  
case "action_apply"://申请
     window.open(path+"ApplyForm?openform&docid="+srcDocID);
     
break;
  
case "action_add"://加入申请
     fn_addApply(srcDocID);
     
break;
  
case "action_review"://查看申请
     window.showModalDialog(path+"select_ApplyBasket?openform","",fnGetModalDialogStatus(320,340));
     
break;
  
case "action_edit"://编辑
     window.open(path+"0/"+srcDocID+"?editdocument");
     
break;
  
case "action_delete"://删除
     var vSelect=document.all.SelectedDOCs;
     
if(vSelect.length){
       
for(i=0;i<vSelect.length;i++){
         
if(vSelect[i].value==srcDocID){vSelect[i].checked=true;break}
       }
 
     }

     
else{
       vSelect.checked
=true;
     }
     
     fn_ViewDelete();
     
break;
  }

}

function popup_mouseover(){
  
var vSrc =v_popup.document.parentWindow.event.srcElement;
  
if(vSrc.tagName=="IMG")vSrc=vSrc.parentElement;
  vSrc.style.color
="#ffffff";
  vSrc.style.background
="#000080";
}

function popup_mouseout(){
  
var vSrc =v_popup.document.parentWindow.event.srcElement;
  
if(vSrc.tagName=="IMG")vSrc=vSrc.parentElement;
  vSrc.style.color
="";
  vSrc.style.background
="";
}

</script>
<div style="display:none;background:#efefef" id="newMenuItemOption">
<table style="font-size:12px" align=center cellpadding=2 width=96%   width="100%" border="0" cellspacing="0" cellpadding="0" ID="Table1">
<tr valign="top"><td id="action_new" width="100%" valign="middle"><img src="" width="18" height="17" class="icon0" align=absmiddle> 新建</td></tr>

<tr valign="top"><td id="action_view" width="100%" valign="middle"><img src="" width="18" height="17" class="icon0" align=absmiddle> 查看</td></tr>

<tr valign="top"><td id="action_apply" width="100%" valign="middle"><img src="" width="18" height="17" class="icon0" align=absmiddle> 申请</td></tr>

<tr valign="top"><td id="action_add" width="100%" valign="middle"><img src="" width="18" height="17" class="icon0" align=absmiddle> 加入申请</td></tr>

<tr valign="top"><td id="action_review" width="100%" valign="middle"><img src="" width="16" height="16" class="icon0" align=absmiddle> 查看申请</td></tr>

<tr valign="top"><td id="action_edit" width="100%" valign="middle"><img src="" width="16" height="15" class="icon0" align=absmiddle> 编辑</td></tr>

<tr valign="top"><td id="action_delete" width="100%" valign="middle"><img src="" width="16" height="15" class="icon0" align=absmiddle> 删除</td></tr>
</table>
</div>
<onclick="fn_showMenuPopup(1);">aa</a>

</body>
</html>
posted @ 2007-04-10 11:36  Kangaroo  阅读(1513)  评论(0编辑  收藏  举报