列表项可上下移动的Multiple列表
来源:网络 责任编辑:栏目编辑 发表时间:2013-07-02 03:31 点击:次
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<STYLE>
BODY, SELECT
{
FONT-FAMILY: TIMES NEW ROMAN;
FONT-SIZE: 10PT;
}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.onload = initPage;
function initPage()
{
btnPutUp.onclick = putUp;
btnPutDown.onclick = putDown;
btnGoUp.onclick = goUp;
btnGoDown.onclick = goDown;
}
function putUp()
{
var strTempValue;
var strTempText;
var intCurIndex;
intCurIndex = sltFruit.selectedIndex;
//alert("intCurIndex: " + intCurIndex);
if (intCurIndex > 0)
{
strTempValue= sltFruit.options.item(intCurIndex).value;
strTempText = sltFruit.options.item(intCurIndex).text;
//alert(strTempText + " - " + strTempValue);
sltFruit.options.item(intCurIndex).value = sltFruit.options.item(intCurIndex - 1).value;
sltFruit.options.item(intCurIndex).text = sltFruit.options.item(intCurIndex - 1).text;
sltFruit.options.item(intCurIndex - 1).value= strTempValue;
sltFruit.options.item(intCurIndex - 1).text = strTempText;
sltFruit.selectedIndex = intCurIndex - 1;
}
}
function putDown()
{
var strTempValue;
var strTempText;
var intCurIndex;
var intIndexCount;
intCurIndex = sltFruit.selectedIndex;
intIndexCount = sltFruit.length;
//alert("intCurIndex: " + intCurIndex);
//alert("intIndexCount: " + intIndexCount);
if (intCurIndex < intIndexCount - 1)
{
strTempValue= sltFruit.options.item(intCurIndex).value;
strTempText = sltFruit.options.item(intCurIndex).text;
//alert(strTempText + " - " + strTempValue);
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<STYLE>
BODY, SELECT
{
FONT-FAMILY: TIMES NEW ROMAN;
FONT-SIZE: 10PT;
}
</STYLE>
<SCRIPT LANGUAGE="JavaScript">
<!--
window.onload = initPage;
function initPage()
{
btnPutUp.onclick = putUp;
btnPutDown.onclick = putDown;
btnGoUp.onclick = goUp;
btnGoDown.onclick = goDown;
}
function putUp()
{
var strTempValue;
var strTempText;
var intCurIndex;
intCurIndex = sltFruit.selectedIndex;
//alert("intCurIndex: " + intCurIndex);
if (intCurIndex > 0)
{
strTempValue= sltFruit.options.item(intCurIndex).value;
strTempText = sltFruit.options.item(intCurIndex).text;
//alert(strTempText + " - " + strTempValue);
sltFruit.options.item(intCurIndex).value = sltFruit.options.item(intCurIndex - 1).value;
sltFruit.options.item(intCurIndex).text = sltFruit.options.item(intCurIndex - 1).text;
sltFruit.options.item(intCurIndex - 1).value= strTempValue;
sltFruit.options.item(intCurIndex - 1).text = strTempText;
sltFruit.selectedIndex = intCurIndex - 1;
}
}
function putDown()
{
var strTempValue;
var strTempText;
var intCurIndex;
var intIndexCount;
intCurIndex = sltFruit.selectedIndex;
intIndexCount = sltFruit.length;
//alert("intCurIndex: " + intCurIndex);
//alert("intIndexCount: " + intIndexCount);
if (intCurIndex < intIndexCount - 1)
{
strTempValue= sltFruit.options.item(intCurIndex).value;
strTempText = sltFruit.options.item(intCurIndex).text;
//alert(strTempText + " - " + strTempValue);
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>