jquery select多選框的左右移動(dòng) 具體實(shí)現(xiàn)代碼
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>無(wú)標(biāo)題文檔</title>
<script type="text/javascript" src="jquery-1.4.4.min.js"></script>
<script type="text/javascript">
/**
*動(dòng)態(tài)的給左邊的下拉列表創(chuàng)建選項(xiàng)
*具體情況可以從數(shù)據(jù)庫(kù)讀取數(shù)據(jù)動(dòng)態(tài)創(chuàng)建選項(xiàng)
*/
$(document).ready(function(){
for(var i=1;i<=5;i++)
{
$("#fb_list").append("<option value='"+i+"'>公開招標(biāo)小型機(jī)采購(gòu)00"+i+"</option>");
}
})
$(function(){
$("#add").click(function(){
if($("#fb_list option:selected").length>0)
{
$("#fb_list option:selected").each(function(){
$("#select_list").append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option");
$(this).remove();
})
}
else
{
alert("請(qǐng)選擇要添加的分包!");
}
})
})
$(function(){
$("#delete").click(function(){
if($("#select_list option:selected").length>0)
{
$("#select_list option:selected").each(function(){
$("#fb_list").append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option");
$(this).remove();
})
}
else
{
alert("請(qǐng)選擇要?jiǎng)h除的分包!");
}
})
})
</script>
</head>
<body>
<table width="95%" cellpadding="0" align="center" class="listshow" border="1" cellspacing="0">
<tr>
<td colspan="4" align="center">選擇分包</td>
</tr>
<tr>
<td class="black" width="30%" align="center" height="150">
<select id="fb_list" multiple="multiple" style="text-align:center;width:300px;height:150px;"></select>
</td>
<td align="center" width="5%">
<input type="button" id="add" value="添加>>" />
<br/>
<br/>
<input type="button" id="delete" value="<<刪除" />
</td>
<td class="black" width="30%" align="center">
<select id="select_list" multiple="multiple" style=" text-align:center;width:300px;height:150px;"></select>
</td>
</tr>
</table>
</body>
</html>
- jQuery實(shí)現(xiàn)左右兩個(gè)列表框的內(nèi)容相互移動(dòng)功能示例
- jQuery實(shí)現(xiàn)可移動(dòng)選項(xiàng)的左右下拉列表示例
- jquery實(shí)現(xiàn)列表上下移動(dòng)功能
- jquery移動(dòng)點(diǎn)擊的項(xiàng)目到列表最頂端的方法
- jQuery實(shí)現(xiàn)用方向鍵控制層的上下左右移動(dòng)
- jQuery讓控件左右移動(dòng)的三種實(shí)現(xiàn)方法
- jQuery slider Content(左右控制移動(dòng))
- jQuery實(shí)現(xiàn)下拉框左右移動(dòng)(全部移動(dòng),已選移動(dòng))
- 基于jquery實(shí)現(xiàn)左右上下移動(dòng)效果
- Jquery實(shí)現(xiàn)多選下拉列表左右移動(dòng)
相關(guān)文章
關(guān)于jQuery里prev()的簡(jiǎn)單操作代碼
這篇文章主要介紹了jQuery里prev()的簡(jiǎn)單操作代碼,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2017-10-10jQuery實(shí)現(xiàn)的簡(jiǎn)單懸浮層功能完整實(shí)例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的簡(jiǎn)單懸浮層功能,結(jié)合完整實(shí)例形式分析了jQuery基于時(shí)間函數(shù)動(dòng)態(tài)修改css樣式實(shí)現(xiàn)窗口浮動(dòng)效果的相關(guān)技巧,需要的朋友可以參考下2017-01-01jquery 面包屑導(dǎo)航 具體實(shí)現(xiàn)
jquery 面包屑導(dǎo)航 具體實(shí)現(xiàn),需要的朋友可以參考一下2013-06-06jquery插件沖突(jquery.noconflict)解決方法分享
本文主要解決了如何讓多個(gè)不同的jQuery版本在同一個(gè)頁(yè)面并存而不沖突的方法,需要的朋友可以參考下2014-03-03jQuery實(shí)現(xiàn)立體式數(shù)字動(dòng)態(tài)增加(animate方法)
本文主要分享了基于jQuery實(shí)現(xiàn)立體式數(shù)字動(dòng)態(tài)增加(animate方法)的實(shí)例代碼。有很好的參考價(jià)值,需要的朋友一起來(lái)看下吧2016-12-12jQuery表單獲取和失去焦點(diǎn)輸入框提示效果的實(shí)例代碼
這篇文章介紹了jQuery表單獲取和失去焦點(diǎn)輸入框提示效果的實(shí)例代碼,有需要的朋友可以參考一下2013-08-08jQuery實(shí)現(xiàn)表單驗(yàn)證功能
這篇文章主要為大家詳細(xì)介紹了jQuery實(shí)現(xiàn)表單驗(yàn)證功能,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下2021-10-10jQuery簡(jiǎn)單實(shí)現(xiàn)點(diǎn)擊文本框復(fù)制內(nèi)容到剪貼板上的方法
這篇文章主要介紹了jQuery簡(jiǎn)單實(shí)現(xiàn)點(diǎn)擊文本框復(fù)制內(nèi)容到剪貼板上的方法,涉及jQuery針對(duì)瀏覽器的判定與剪貼板的讀寫操作技巧,需要的朋友可以參考下2016-08-08