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;
                }
  • 相关阅读:
    Digital Square(hdu4394)搜索
    Substrings(hdu1238)字符串匹配
    Graveyard(poj3154)
    数据库的范式理论
    模和除
    You can Solve a Geometry Problem too (hdu1086)几何,判断两线段相交
    对vector等STL标准容器进行排序操作(转!)
    0 or 1(hdu2608)数学题
    LintCode 4.丑数
    LintCode 9.Fizz Buzz问题
  • 原文地址:https://www.cnblogs.com/Magicam/p/1816760.html
Copyright © 2011-2022 走看看