⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nagive.js

📁 在线订餐系统源码 一个小型的在线订餐管理系统源码
💻 JS
字号:
function Expaned(arg,obj)
{
 DeleteTableRow();
 var object=view_aspx.GetItems(arg);
 var item=object.value.split("|");
 ExpTable(item,obj);
 var tableobj=document.getElementById("itemList");
 var rowobj;
 if(item.length==2)
 {
  temp=item[0].split(",");
  rowobj=tableobj.insertRow(tableobj.rows.length );
  var cell=rowobj.insertCell(rowobj.cells.length);
  cell.innerHTML="<td  valign=bottom width=\"52%\" height=\"170\" ><img src="+temp[2]+"  align=left height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+temp[1]+"); return false;\" alt="+temp[0]+" /></td>";
  return;
 }
 for(i=0;i<item.length-1;i++)
 {
  var oneitem=item[i].split(",");
  
  if(i>5)
    break;
  else if(i%2==0)
  {
   rowobj=tableobj.insertRow(tableobj.rows.length );
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML="<td width=\"52%\" height=\"170\"   valign=bottom ><img src="+oneitem[2]+"   height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+oneitem[1]+"); return false;\" alt="+oneitem[0]+" /></td>";
  }
  else if(i%2!=0)
  {
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML="<td width=\"48%\" height=\"170\"   valign=bottom ><img src="+oneitem[2]+"  height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+oneitem[1]+"); return false;\" alt="+oneitem[0]+" /></td>";
  }
 }
 
}

function DeleteTableRow() 
{ 
var tableobj=document.getElementById("itemList");
if(tableobj.rows.length>0)
{
var m=tableobj.rows.length;
for(i=0;i<m;i++)
  tableobj.deleteRow(0);
}
}

function ExpTable(items,obj)
{
 var tableobj=document.getElementById("list");
 for(i=0;i<tableobj.rows.length;i++)
 {
  if(tableobj.rows[i].expand==true)
  {
   var txt=tableobj.rows[i].childNodes[0].childNodes[0].childNodes[0].childNodes[0].innerText;
   var temparg=tableobj.rows[i].childNodes[0].childNodes[0].systemid;
   tableobj.rows[i].childNodes[0].innerHTML=txt;
   tableobj.rows[i].childNodes[0].style.backgroundColor="LightPink";
   
   tableobj.rows[i].childNodes[0].onclick=new Function("Expaned("+temparg+",this)");
   tableobj.rows[i].expand=false;
  }
 }
 obj.parentElement.setAttribute("expand",true);
 obj.style.backgroundColor="";
 obj.onclick="";
 var title=obj.innerHTML;
 var txt1="";
 txt1="<tr><th scope=\"col\" style=\"background-color:LightSkyBlue\" >"+title+"</td></tr>"
 for(i=0;i<items.length-1;i++)
 {
  var oneItem=items[i].split(",");
  txt1+="<tr><th scope=\"col\" class=\"label1\" onclick=\"sexyBOX('500',"+oneItem[1]+"); return false;\">"+oneItem[0]+"</td></tr>";

 }
 var txt="<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
 txt+=txt1;
 txt+="</table>";
 obj.innerHTML=txt;
 obj.childNodes[0].setAttribute("systemid",oneItem[3]);
 
 
}
function $(v) { return(document.getElementById(v)); }
function $S(v) { return($(v).style); }
function agent(v) { return(Math.max(navigator.userAgent.toLowerCase().indexOf(v),0)); }
function isset(v) { return((typeof(v)=='undefined' || v.length==0)?false:true); }
function XYwin(v) { var z=agent('msie')?Array(document.body.clientHeight,document.body.clientWidth):Array(window.innerHeight,window.innerWidth); return(isset(v)?z[v]:z); }

function sexyTOG() { document.onclick=function(){ $S('sexyBG').display='none'; $S('sexyBOX').display='none'; document.onclick=function(){}; }; }
function sexyBOX(b,id) {
var obj=view_aspx.GetOneItem(id);
var item=obj.value.split("*");
$S('sexyBG').height=XYwin(0)+'px'; 
$S('sexyBG').display='block'; 
$('sexyBOX').innerHTML="<div class=\"sexyT\">  "+item[0]+"   <span onclick=\"addmsg('"+id+"')\">[评论此菜]</span><\/div><img src="+item[2]+" height=170 width=210 align=center /><br/>价格:"+item[1]+"<br/>"+item[3]+"<hr></hr><table  width=\"100%\" id=\"table1\"><tr class=\"tableline\"><td onclick=\"readMsg("+id+",this)\">查看此菜的评价</td></tr></table><hr></hr><div class=\"sexyX\" onMouseMove=\"setTimeout('sexyTOG()',1);\" onMouseOut=\"setTimeout('document.onclick=function(){}',1);\" style=\"cursor:pointer;\">(关闭)"+"<\/div>"; 
$S('sexyBOX').left=Math.round((XYwin(1)-b)/2)+'px'; 
$S('sexyBOX').width=b+'px'; 
$S('sexyBOX').display='block'; }

window.onload=function(){
document.body.innerHTML="<div id=\"sexyBG\"></div><div id=\"sexyBOX\"></div>"+document.body.innerHTML;
}



function sexyBOX1(b,id) {
var obj=default_aspx.GetItem(id);
var item=obj.value.split("*");
alert(obj.value);
$S('sexyBG').height=XYwin(0)+'px'; 
$S('sexyBG').display='block'; 
$('sexyBOX').innerHTML="<div class=\"sexyT\">  "+item[0]+"   <span onclick=\"addmsg('"+id+"')\">[评论此菜]</span><\/div><img src="+item[2]+" height=170 width=210 align=center /><br/>价格:"+item[1]+"<br/>"+item[3]+"<hr></hr><table  width=\"100%\" id=\"table1\"><tr class=\"tableline\"><td onclick=\"readMsg("+id+",this)\">查看此菜的评价</td></tr></table><hr></hr><div class=\"sexyX\" onMouseMove=\"setTimeout('sexyTOG()',1);\" onMouseOut=\"setTimeout('document.onclick=function(){}',1);\" style=\"cursor:pointer;\">(关闭)"+"<\/div>"; 
$S('sexyBOX').left=Math.round((XYwin(1)-b)/2)+'px'; 
$S('sexyBOX').width=b+'px'; 
$S('sexyBOX').display='block'; }
function readMsg(id,obj)
{
 var tableobj=obj.parentNode.parentNode.parentNode;
 var object=view_aspx.GetItemMsg(id);
 if(object.value!="")
 {
  tableobj.deleteRow(0);
  var data=object.value.split("|");
  for(i=0;i<data.length-1;i++)
  {
   var temp=data[i].split("*");
   var rowobj=tableobj.insertRow(tableobj.rows.length);
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML=temp[0]+"说:"+temp[1];
  }
 }
}
function addmsg(id)
{
 window.open("ItemMsg.aspx?id="+id,"_blank","height=200,Width=310");
}
function search(obj)
{
 var txt=obj.value;
 txt=txt.replace(/(^\s*)|(\s*$)/g, "");
 var object=view_aspx.GetSearch(txt);
if(object.value=="")
{
   document.getElementById("showmenu").innerHTML="";
   document.getElementById("showmenu").style.display="none";
}
else
{
   checkword(object.value,obj); 
}
}
function losttest()
{
       document.getElementById("showmenu").innerHTML="";
       document.getElementById("showmenu").style.display="none";
}
function checkword(alltxt,obj)
{
    var t=obj.offsetTop;  
    var l=obj.offsetLeft;  
    while(obj=obj.offsetParent)
    {  
        t+=obj.offsetTop;  
        l+=obj.offsetLeft;  
    }  
   document.getElementById("showmenu").style.left=l;
   document.getElementById("showmenu").style.top=t+20;
   var alltxt_xiang=alltxt.split(",");
   var inhtml="<ul>"
   var isyou=0;
   var temp=0;
   for (i=0;i<alltxt_xiang.length-1;i++)
   {
      
           inhtml=inhtml+"<li onclick=\"Setvalue('"+alltxt_xiang[i]+"');document.getElementById('showmenu').style.display='none';\"   onmouseover=\"this.style.backgroundColor='#666666'\" onmouseout=\"this.style.backgroundColor=''\" style=\"font-size:11px;margin-left:-30px;list-style:none; magin:0; padding:0;\">"+alltxt_xiang[i]+"</li>";
           isyou=1;
           temp=i;
      
   }
   inhtml=inhtml+"<li onclick=\"document.getElementById('showmenu').style.display='none';\"   onmouseover=\"this.style.backgroundColor='#666666'\" onmouseout=\"this.style.backgroundColor=''\" style=\"font-size:11px;margin-left:-30px;list-style:none; magin:0; padding:0;\">"+alltxt_xiang[temp+1]+"</li>";
   inhtml=inhtml+"</ul>";
   if (isyou==1)
   {
       document.getElementById("showmenu").innerHTML=inhtml;
       document.getElementById("showmenu").style.display="";
   }
   else
   {
       document.getElementById("showmenu").innerHTML="";
       document.getElementById("showmenu").style.display="none";
   }
  
}
function Setvalue(arg)
{
 document.getElementById('keyword').value=arg;
 ExpanedBySearch(arg);
}
function ExpanedBySearch(arg)
{
 DeleteTableRow();
 var object=view_aspx.GetSearchItem(arg);
 var item=object.value.split("|");
 var tableobj=document.getElementById("itemList");
 var rowobj;
 if(item.length==2)
 {
  temp=item[0].split("*");
  rowobj=tableobj.insertRow(tableobj.rows.length );
  var cell=rowobj.insertCell(rowobj.cells.length);
  cell.innerHTML="<td  valign=bottom width=\"52%\" height=\"170\" ><img src="+temp[1]+"  align=left height=170 width=210 class=\"indexpic\" onclick=\"sexyBOX('500',"+temp[2]+"); return false;\" alt="+temp[0]+" /></td>";
  return;
 }
 for(i=0;i<item.length-1;i++)
 {
  var oneitem=item[i].split("*");
  
  if(i>5)
    break;
  else if(i%2==0)
  {
   rowobj=tableobj.insertRow(tableobj.rows.length );
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML="<td width=\"52%\" height=\"170\"   valign=bottom ><img src="+oneitem[1]+"   height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+oneitem[2]+"); return false;\" alt="+oneitem[0]+" /></td>";
  }
  else if(i%2!=0)
  {
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML="<td width=\"48%\" height=\"170\"   valign=bottom ><img src="+oneitem[1]+"  height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+oneitem[2]+"); return false;\" alt="+oneitem[0]+" /></td>";
  }
 }
}

function ItemInit()
{
 DeleteTableRow();
 var object=view_aspx.ItemRandom();
 var item=object.value.split("|");
 var tableobj=document.getElementById("itemList");
 var rowobj;
 if(item.length==2)
 {
  temp=item[0].split("*");
  rowobj=tableobj.insertRow(tableobj.rows.length );
  var cell=rowobj.insertCell(rowobj.cells.length);
  cell.innerHTML="<td  valign=bottom width=\"52%\" height=\"170\" ><img src="+temp[1]+"  align=left height=170 width=210 class=\"indexpic\" onclick=\"sexyBOX('500',"+temp[2]+"); return false;\" alt="+temp[0]+" /></td>";
  return;
 }
 for(i=0;i<item.length-1;i++)
 {
  var oneitem=item[i].split("*");
  
  if(i>5)
    break;
  else if(i%2==0)
  {
   rowobj=tableobj.insertRow(tableobj.rows.length );
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML="<td width=\"52%\" height=\"170\"   valign=bottom ><img src="+oneitem[1]+"   height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+oneitem[2]+"); return false;\" alt="+oneitem[0]+" /></td>";
  }
  else if(i%2!=0)
  {
   var cell=rowobj.insertCell(rowobj.cells.length);
   cell.innerHTML="<td width=\"48%\" height=\"170\"   valign=bottom ><img src="+oneitem[1]+"  height=170 width=210 class=\"indexpic\"  onclick=\"sexyBOX('500',"+oneitem[2]+"); return false;\" alt="+oneitem[0]+" /></td>";
  }
 }
 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -