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;
                }
  • 相关阅读:
    去除金额千分位,还原成数字
    替换对象的key
    合并两个对象的属性
    js常用数组方法
    document对象的一些属性
    js数字四舍五入保留n位小数
    js时间日期类常用方法
    数字转换成千分位格式
    valueOf获取日期时间初始值
    常见的数据库Cause:Packet for query is too large(xxx > 1024)
  • 原文地址:https://www.cnblogs.com/Magicam/p/1816760.html
Copyright © 2011-2022 走看看