拿分来吧!
function moveup(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
if(tar.options[i].selected && i!=0)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i-1].text
nValue = tar.options[i-1].value
tar.options[i-1].text = Text
tar.options[i-1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
tar.options[i-1].selected=true;
break;
}
}
}
----------------------------------
function movedown(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
if(tar.options[i].selected && i!=max)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i+1].text
nValue = tar.options[i+1].value
tar.options[i+1].text = Text
tar.options[i+1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
tar.options[i+1].selected=true;
break;
}
}
}
------------------------------------如果出问题的话试试下面的
function moveup(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
if(tar.options[i].selected && i!=0)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i-1].text
nValue = tar.options[i-1].value
tar.options[i-1].text = Text
tar.options[i-1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
//这里在移动时出问题---修改人:赵昕(2001-12-26)
tar.options[i-1].selected=true;
//更改如下---修改人:赵昕(2001-12-26)
if(i==0)
{tar.options[i-1].selected=false;
tar.options[i].selected=false;
}
else
{tar.options[i-1].selected=true;
tar.options[i].selected=false;
} break;
}
}
}
function movedown(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
//在移动时出问题---修改人:赵昕(2001-12-26)
if(tar.options[i].selected && i!=max)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i+1].text
nValue = tar.options[i+1].value
tar.options[i+1].text = Text
tar.options[i+1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
tar.options[i+1].selected=true;
break; //更改如下---修改人:赵昕(2001-12-26)
maxb = max-1;
if(tar.options[i].selected && i!=maxb)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i+1].text
nValue = tar.options[i+1].value
tar.options[i+1].text = Text
tar.options[i+1].value = Value tar.options[i].text = nText
tar.options[i].value = nValue
if(i==maxb)
{tar.options[i+1].selected=false;
tar.options[i].selected=false;
}
else
{tar.options[i+1].selected=true;
tar.options[i].selected=false;
}
break;
}
}
}
function moveup(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
if(tar.options[i].selected && i!=0)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i-1].text
nValue = tar.options[i-1].value
tar.options[i-1].text = Text
tar.options[i-1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
tar.options[i-1].selected=true;
break;
}
}
}
----------------------------------
function movedown(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
if(tar.options[i].selected && i!=max)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i+1].text
nValue = tar.options[i+1].value
tar.options[i+1].text = Text
tar.options[i+1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
tar.options[i+1].selected=true;
break;
}
}
}
------------------------------------如果出问题的话试试下面的
function moveup(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
if(tar.options[i].selected && i!=0)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i-1].text
nValue = tar.options[i-1].value
tar.options[i-1].text = Text
tar.options[i-1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
//这里在移动时出问题---修改人:赵昕(2001-12-26)
tar.options[i-1].selected=true;
//更改如下---修改人:赵昕(2001-12-26)
if(i==0)
{tar.options[i-1].selected=false;
tar.options[i].selected=false;
}
else
{tar.options[i-1].selected=true;
tar.options[i].selected=false;
} break;
}
}
}
function movedown(tar)
{
max = tar.options.length;
for (i=0; i<max; i++)
{
//在移动时出问题---修改人:赵昕(2001-12-26)
if(tar.options[i].selected && i!=max)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i+1].text
nValue = tar.options[i+1].value
tar.options[i+1].text = Text
tar.options[i+1].value = Value
tar.options[i].text = nText
tar.options[i].value = nValue
tar.options[i+1].selected=true;
break; //更改如下---修改人:赵昕(2001-12-26)
maxb = max-1;
if(tar.options[i].selected && i!=maxb)
{
Text = tar.options[i].text
Value = tar.options[i].value
nText = tar.options[i+1].text
nValue = tar.options[i+1].value
tar.options[i+1].text = Text
tar.options[i+1].value = Value tar.options[i].text = nText
tar.options[i].value = nValue
if(i==maxb)
{tar.options[i+1].selected=false;
tar.options[i].selected=false;
}
else
{tar.options[i+1].selected=true;
tar.options[i].selected=false;
}
break;
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货