zoukankan      html  css  js  c++  java
  • JQuery ListBox间移动和ListBox内上下移动

    var $btnUp = $("#ChooseUserControl1_btnUp");
                var $btnDown = $("#ChooseUserControl1_btnDown");
    //选择的联系人上下移动///////////////////////////////////
                $btnUp.click(function()
                {
                    $lbSelLinkMan.find("option:selected").each(function(index, item)
                    {        
                        ListBox_Order("up");
                    });
    return false;
                });
                $btnDown.click(function()
                {
                    $lbSelLinkMan.find("option:selected").each(function(index, item)
                    {
                        ListBox_Order("down");
                    });
    return false;
                });
                function ListBox_Order(action)
                {               
                    var size = $lbSelLinkMan.find("option").size();
                    var selsize = $lbSelLinkMan.find("option:selected").size();
    if (size > 0 && selsize > 0)
                    {                   
                        $lbSelLinkMan.find("option:selected").each(function(index, item)
                        {
    if (action == "up")
                            {
                                $(item).prev().insertAfter($(item));
    return false;
                            }
    else if (action == "down")//down时选中多个连靠则操作没效果
                            {
                                $(item).next().insertBefore($(item));
    return false;
                            }
                        })
                    }
    return false;
                }

  • 相关阅读:
    Linux学习65 实战使用awk高级功能统计网络请求连接状态
    Linux学习64 awk使用与实战
    Linux学习63 shell脚本高级编程-信号捕捉实战
    Linux学习62 shell脚本高级编程-数组和字符串处理
    Linux学习61 企业军工级别安全策略-SELinux简介
    Linux学习60 centos7新特性-systemd及systemctl实战
    Linux学习59 shell脚本高级用法-函数编程与应用实战
    【HBase】HBase与MapReduce的集成案例
    【HBase】底层原理
    【HBase】Java实现过滤器查询
  • 原文地址:https://www.cnblogs.com/chen110xi/p/2453776.html
Copyright © 2011-2022 走看看