两个多选框(select)之间值的左右上下移动

jQuery实现select左右移动 代码如下: 效果见文末 <html> <head> <meta charset="UTF-8"> <title></title> <style> select { width: 150px; height: 300px; } </style> <scrip... 阅读详情
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>两个多选框(select)之间值的左右上下移动</title>
</head>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.js"></script>

<script type="text/javascript">
    $(function () {
        $("#s1 option:first,#s2 option:first").attr("selected", true);
        $("#s1").dblclick(function () {
            var alloptions = $("#s1 option");
            var so = $("#s1 option:selected");
            if (so === null || so == "undefined") {
                return;
            }
            try {
                var a = (so.get(so.length - 1).index == alloptions.length - 1) ? so.prev().attr("selected", true) : so.next().attr("selected", true);
            } catch (e) {
                return;
            }
            $("#s2").append(so);
        });
        $("#s2").dblclick(function () {
            var alloptions = $("#s2 option");
            var so = $("#s2 option:selected");
            if (so === null || so == "undefined") {
                return;
            }
            try {
                var a = (so.get(so.length - 1).index == alloptions.length - 1) ? so.prev().attr("selected", true) : so.next().attr("selected", true);
            } catch (e) {
                return;
            }
            $("#s1").append(so);
        });
        $("#add").click(function () {
            var alloptions = $("#s1 option");
            var so = $("#s1 option:selected");
            var a = (so.get(so.length - 1).index == alloptions.length - 1) ? so.prev().attr("selected", true) : so.next().attr("selected", true);
            $("#s2").append(so);
        });
        $("#remove").click(function () {
            var alloptions = $("#s2 option");
            var so = $("#s2 option:selected");
            var a = (so.get(so.length - 1).index == alloptions.length - 1) ? so.prev().attr("selected", true) : so.next().attr("selected", true);
            $("#s1").append(so);
        });
        $("#addall").click(function () {
            $("#s2").append($("#s1 option").attr("selected", true));
        });
        $("#removeall").click(function () {
            $("#s1").append($("#s2 option").attr("selected", true));
        });
        $("#s1up").click(function () {
            var so = $("#s1 option:selected");
            if (so.get(0).index !== 0) {
                so.each(function () {
                    $(this).prev().before($(this));
                });
            }
        });
        $("#s1down").click(function () {
            var alloptions = $("#s1 option");
            var so = $("#s1 option:selected");
            if (so.get(so.length - 1).index != alloptions.length - 1) {
                for (i = so.length - 1; i >= 0; i = 1 - 1) {
                    var item = $(so.get(i));
                    item.insertAfter(item.next());
                }
            }
        });
        $("#s2up").click(function () {
            var so = $("#s2 option:selected");
            if (so.get(0).index !== 0) {
                so.each(function () {
                    $(this).prev().before($(this));
                });
            }
        });
        $("#s2down").click(function () {
            var alloptions = $("#s2 option");
            var so = $("#s2 option:selected");
            if (so.get(so.length - 1).index != alloptions.length - 1) {
                for (i = so.length - 1; i >= 0; i--) {
                    var item = $(so.get(i));
                    item.insertAfter(item.next());
                }
            }
        });
    });

</script>

<table width="600" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="100">
            <select name="s1" size="10" multiple="multiple" id="s1" style=" width:200px" ,style="height:300px;">
                <option value="opt01">option01</option>
                <option value="opt02">option02</option>
                <option value="opt03">option03</option>
                <option value="opt04">option04</option>
                <option value="opt05">option05</option>
                <option value="opt06">option06</option>
                <option value="opt07">option07</option>
                <option value="opt08">option08</option>
                <option value="opt09">option09</option>
                <option value="opt10">option10</option>
            </select>
        </td>
        <td width="37" align="center">
            <input type="button" name="addall" id="addall" value=">|"/><br/>
            <input type="button" name="add" id="add" value=">>"/><br/>
            <input type="button" name="remove" id="remove" value="<<"/><br/>
            <input type="button" name="removeall" id="removeall" value="|<"/>
        </td>
        <td width="100">
            <select name="s2" size="10" multiple="multiple" id="s2" style=" width:200px height: 300px;">
            </select>
        </td>
    </tr>
</table>



</html>

 

基于Element UI的Select控件实现多选框中单行显示&左右移动 控件主要功能,可以单行显示多选的tag,并且可以利用左右键移动tag在组件中的位置 直接上代码: <el-select v-model="tags" ref="tagsSelect" multiple filterable remote clearable popper-class="tag-input-options" :remote-... 阅读详情

相关推荐

select选择框内容左右移动

select选择框内容左右移动源码,请大家参考。

JQuery实现下拉列表选中条目左右移动

/appendTo 获取右边选中的option,将其移动到左边下拉列表中。//获取右边的下拉列表对象,append(左边下拉列表选中的option)//需求:实现下拉列表选中条目左右选择功能。

zhansan的博客 447

用js实现两个select下拉框之间的元素互相移动

NULL 博文链接:https://yuxingxing1988.iteye.com/blog/1090351

2个下拉列表中的元素相互移动

案例完成代码与解析

yushu778的博客 938

JavaScript实现两个select下拉框选项左移右移

主要介绍了JavaScript实现两个select下拉框选项左移右移功能,js实现下拉框元素互相移动,具有一定的参考价值,感兴趣的小伙伴们可以参考一下

Python Trimesh库实战:5分钟搞定STL文件解析与3D模型可视化

本文介绍了如何使用Python的Trimesh库快速解析STL文件并进行3D模型可视化。通过简洁的代码示例,演示了从环境搭建、模型加载、几何数据提取到基础变换和批量处理的核心流程,帮助开发者和工程师在5分钟内高效完成3D数据处理与可视化任务。

weixin_32005771的博客 161

multiselect选中_multi-select 左右选择插件

multi-select 前端左右两端多选插件1、html 部分:{% extends 'base-layer.html' %}{% load staticfiles %}{% block css %}.ms-container {width: 551px;}{% endblock %}{% block main %}{% csrf_token %}选择全部取消全部{% for item in l...

weixin_39703561的博客 696

TwinCAT 3 实战:手把手教你用PLC和C++读写第三方伺服驱动器的CoE参数

本文详细介绍了在TwinCAT 3环境中通过PLC和C++两种技术路线实现对第三方伺服驱动器CoE参数的精准操控。从环境准备到具体实现,包括硬件配置、核心函数使用及性能优化策略,为工程师提供了全面的实战指南。特别针对CoE参数访问的效率和稳定性问题,给出了实用的调试技巧和异常处理方案。

weixin_33743248的博客 446

【纯JavaScript 制作多选框逻辑实现】

【纯JavaScript 制作多选框】

阿牛哥的博客 505

Windows下高效部署llama.cpp:从环境配置到模型量化的完整指南

本文提供了一份详尽的Windows系统下部署llama.cpp的完整指南。内容涵盖从Python环境配置、使用CMake与MinGW编译工具链的搭建,到编译llama.cpp项目、获取并转换模型为GGUF格式,以及执行模型量化和基础推理测试的全过程。指南旨在帮助开发者在普通Windows电脑上,无需高端显卡,仅凭CPU即可高效运行大语言模型,并重点解决了部署过程中常见的环境与编译错误。

weixin_28841265的博客 882

汽车ECU诊断入门:手把手教你用UDS协议(ISO14229)读取和清除故障码

本文详细介绍了如何使用UDS协议(ISO14229)进行汽车ECU诊断,包括故障码读取与清除的完整流程。从诊断环境搭建、UDS协议基础到实战案例分析,手把手教你掌握0x19诊断服务、安全访问机制等核心技能,适用于汽车电子工程师和诊断开发人员。

weixin_33701251的博客 457

select多选框在移动端和PC端的不同表现

select多选框的整体思路是:将被选中的值连成字符串后赋值给某标签(以input、div标签为例)即可,下面会进行详细说明。 ps:PC端和移动端的js代码写的不太一样,但是原理是一样的(因为第一个是我写的,另一个是别人写的…)。 整体效果图: 一、select多选框在PC端的表现,类似于下拉框,可自己调整宽高,需要配合Ctrl键进行多选。为了宽高不规整影响页面样式,可对option进行定位并...

weixin_44558497的博客 9208

金蝶云星空API实战:从零到一,用Postman打通业务数据流

本文详细介绍了如何使用Postman调试金蝶云星空API,从创建第三方应用到实战调试技巧,帮助开发者快速打通业务数据流。文章重点讲解了API配置的关键细节、常见问题排查方法以及自动化测试方案,提升开发效率与准确性。

weixin_33712987的博客 522

二级联动及左右select选择

js实现二级联动和jquery实现左右select选择

qq_45398309的博客 5858

Qt之QMqtt 发送图片数据

MQTT是一个基于客户端-服务器的消息发布/订阅传输协议;MQTT协议是轻量、简单、开放和易于实现的,这些特点使它适用范围非常广泛;在很多情况下,包括受限的环境中,如:机器与机器(M2M)通信和物联网(IoT);其在,通过卫星链路通信传感器、偶尔拨号的医疗设备、智能家居、及一些小型化设备中已广泛使用;

Ilson_的博客 1437

详解大端模式和小端模式

详解大端模式和小端模式 一、大端模式和小端模式的起源         关于大端小端名词的由来,有一个有趣的故事,来自于Jonathan Swift的《格利佛游记》:Lilliput和Blefuscu这两个强国在过去的36个月中一直在苦战。战争的原因:大家都知道,吃鸡蛋的时候,原始的方法是打破鸡蛋较大的一端,可以那时的皇帝的祖父由于小时侯吃鸡蛋,按这种方法把手指弄破了,因此他的父亲,就下令,命令

ce123的技术博客 19万+

jquery实现select多选框的左右移动

公开招标小型机采购00"+i+"选择分包

weixin_71792169的博客 622

图神经网络实战——利用节点回归预测网络流量

在机器学习中,回归指的是对连续值的预测。通常与分类形成鲜明对比,分类的目标是找到正确的类别(即离散值,而非连续值)。在图数据中,分类和回归分别对应于节点分类和节点回归。在本节中,我们将尝试预测每个节点的连续值,而非分类变量。

盼小辉丶的博客 1万+

javascript select控件的使用及左右移动item的逻辑处理

html中select控件,应该也就是下拉选项框。不过也可以不是下拉的形式,可以是多行显示的。 这里演示的是,左边一个下拉多选框,右边还有一个下拉多选框。然后,双击左边的下拉多选框的条目,就将其移到右边的下拉多选框中,右边的同理。 还有就是,左边的内容一键移到右边,和右边的一键移到左边的操作。 ps:我感觉javascript最方便的一点就是,可以直接在html或者说浏览器中运行,不需要特别的运行

Cat的专栏 1820

廖雪峰Python教程[完整版]

廖雪峰的python教程整理的,已经排好版了,而且还是完整的,适合小白

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

实现select multiple左右添加和删除功能

很久很久以前,我刚听说过JQuery,然后在不知道javaeye还是blogjava上看到一篇《实现select multiple左右添加和删除功能》的文章,写的很黄很暴力,我一紧张就打印下来了,昨天晚上拉肚子上厕所,突然找出打印稿,在厕所上看了一下,发现不错。这个文章的原作者我已经不知道是谁了,但是我要感谢他的奉献精神。 为了表示对他的尊敬,我修改了他的代码,为了更通用。代码例子任然沿用原...

teamojiao的专栏 113

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

选择左边多选框的值移动到右边多选框

JS代码如下: /** * 移动select的部分内容,必须存在value,此函数以value为标准进行移动 * oSourceSel: 源列表框对象 * oTargetSel: 目的列表框对象 */ function moveSelected(oSourceSel, oTargetSel) { //建立存储value和text的缓存数组 va

southcamel的专栏 8445

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

两个select列表相互移动

[img]http://dl2.iteye.com/upload/attachment/0091/5182/f8e27c14-43c5-3990-857b-770030e8bb3c.png[/img] 多选框 arrayList 以ascii进行排序 blue red white 001 1000 ...

zz_xyz的博客 250

jquery 穿梭框,可上下左右,全选移动

HTML部分 <table align="center" cellpadding="0" cellspacing="0"> <tr> <td> 可选择表项 </td> <td></td> <td> 已选择表项 </td> </tr> <tr> <td> <select mult

weixin_43824848的博客 728
上一篇: java SXSSF 导出excel 合并单元格,设置打印分页
下一篇: 如何在Linux中查找Nginx安装目录
ole_triangle_java
博客等级 码龄10年 82粉丝 83原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值