select不支持双击dbclick事件_HTML/Xhtml_网页制作
XML/HTML Code复制内容到剪贴板
- div class="centent" style="width:200px; float:left; margin-right:20px;">
-
select multiple="multiple" id="select1" style="width:150px; height:160px;">
-
option value="1">选项1option>
-
option value="2">选项2option>
-
option value="3">选项3option>
-
option value="4">选项4option>
-
option value="5">选项5option>
-
select>
-
-
div>
-
span id="add" style="display:block; width:140px; cursor:pointer;">选中添加到右边>>span>
-
span id="addAll" style="display:block; width:140px; cursor:pointer;">全部添加到右边>>span>
-
div>div>
-
div class="centent" style="width:200px; float:left; margin-right:20px;">
-
select multiple="multiple" id="select2" style="width:150px; height:160px;">
-
select>
-
div>
-
span id="add1" style="display:block; width:140px; cursor:pointer;">选中删除到左边span>
-
span id="addAll1" style="display:block; width:170px; cursor:pointer;">全部选中删除到左边span>
-
div>
-
div>
JavaScript Code复制内容到剪贴板
- <script><span class="string">"text/javascript"</script>>
-
-
-
$(function(){
-
-
$("#add").click(function(){
-
$option = $("#select1 option:selected");
-
$option.appendTo("#select2");
- })
-
$("#addAll").click(function(){
-
$option = $("#select1 option");
-
$option.appendTo("#select2");
- })
-
$("#select1").dbclick(function(){
-
$option = $("#select1 option:selected",this);
-
$option.appendTo("#select2");
- })
-
-
$("#add1").click(function(){
-
$option = $("#select2 option:selected");
-
$option.appendTo("#select1");
- })
-
$("#addAll1").click(function(){
-
$option = $("#select2 option");
-
$option.appendTo("#select1");
- })
-
$("#select2").dbclick(function(){
-
$option = $("option:selected",this);
-
$option.appendTo("#select1");
- })
- })
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
作者最新文章
-
2024-10-22 09:46:29
-
2024-10-13 13:53:41
-
2024-10-12 12:15:51
-
2024-10-11 22:47:31
-
2024-10-11 19:36:51
-
2024-10-11 15:50:41
-
2024-10-11 15:07:41
-
2024-10-11 14:21:21
-
2024-10-11 12:59:11
-
2024-10-11 12:17:31