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

📄 items.js

📁 CRM系统源码
💻 JS
字号:
// JScript 文件
function selectall()
{ 
var lst1=window.document.getElementById("lbz");
var length=lst1.options.length;
var hf=window.document.getElementById("hf");
for(var i=0;i<length;i++)
{
  var v=lst1.options[i].value;
  var t=lst1.options[i].text;
  var lst2=window.document.getElementById("lby");
  lst2.options[i]=new Option(t,v,true,true);
  hf.value+=v+",";
}
}

function deleteall()
{ 
  var lst2=window.document.getElementById("lby");
  var length = lst2.options.length;
  for(var i=length;i>0;i--)
   {
   lst2.options[i-1].parentNode.removeChild(lst2.options[i-1]);
   } 
   var hf=window.document.getElementById("hf");
   hf.value='';  
}

function selectone()
{
  var lst1=window.document.getElementById("lbz");
  var lst2=window.document.getElementById("lby");
  var hf=window.document.getElementById("hf");
  var lstindex=lst1.selectedIndex;
            var length = lst2.options.length;
            var isExists = false;
            if(lstindex<0)
                return;
            else if(length != null)
            {
                for(var i=0;i < length; i++)
                {
                     if(lst2.options[i].text == lst1[lstindex].text&&lst2.options[i].value == lst1[lstindex].value)
                     {
                        isExists = true;
                     }
                }
            }
            else
            {
                return;
            }
            if (isExists == false)
            {
                var v = lst1.options[lstindex].value;
                var t = lst1.options[lstindex].text;
                lst2.options[lst2.options.length] = new Option(t,v,true,true);
                hf.value+=v+",";
            }
            else
            {
                alert("所选项目已经存在");
                return false;
            }           
}

function DelOne()
        {
            var lst2=window.document.getElementById("lby");
            var lst1=window.document.getElementById("lbz");
            var lstindex=lst2.selectedIndex;
            if(lstindex>=0)
            {
                var vv = lst2.options[lstindex].value+",";
                var v = lst2.options[lstindex].value;
                var t = lst2.options[lstindex].text;
                lst1.options[lst1.options.length] = new Option(t,v,true,true);
                var hf=window.document.getElementById("hf");
                hf.value=hf.value.replace(vv,'');
                lst2.options[lstindex].parentNode.removeChild(lst2.options[lstindex]); 
            }
        }

⌨️ 快捷键说明

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