📄 multiselect.js
字号:
function addit(o1,o2)
{
var num=0;
var flag=1;
var index=0;
// index=o2.length;
for (i=0;i<o1.options.length; i++)
{ if (o1.options[i].selected==true)
{
for(j=0;j<o2.length;j++)
{
if(o1.options[i].value==o2.options[j].value)
{
flag=0;
break;
}
}
if(flag)
{
o2.length++;
o2.options[o2.length-1]=new Option( o1.options[i].text ,o1.options[i].value);
}
flag=1;
}
}
}
function addall(o1,o2)
{
flag=1;
for (i=0;i<o1.options.length; i++)
{
for(j=0;j<o2.length;j++)
{
if(o1.options[i].value==o2.options[j].value)
{
flag=0;
break;
}
}
if(flag)
{
o2.length++;
o2.options[o2.length-1]=new Option( o1.options[i].text ,o1.options[i].value);
}
flag=1;
}
}
function removeit(o2)
{
var list = o2;
var indexB = list.options.selectedIndex;
var lengthcount=0;
for (index=list.options.length-1;index>=0;index--)
{
if( index >= 0 && list.options[index].selected==true )
{
if (index==list.length-1)
{
list.length=list.length-1;
}
else
{
for( x = index; x < list.length-1; x++ )
{
current = list.options[ x ];
next = list.options[ x + 1 ];
current.text = next.text;
current.value = next.value;
}
list.length=list.length-1;
}
// for (i=0; i<list.length; i++)
//{
// list[i].selected=true;
// }
}
}
}
function removeall(o2)
{
var list = o2;
list.length=0
}
function sendit(o2)
{
if(o2.length==0)
{
alert(sAlert);
return false;
}
for(j=0;j<o2.length;j++)
{
o2.options[j].selected=true;
}
return true;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -