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;
                }
  • 相关阅读:
    pip安装flask问题解决
    GRE新东方推荐学习方法(2010年左右)
    使用eclipse IDE遇到的问题
    2014年互联网大会(商业价值,北京,7月)
    Indexing the World Wide Web: the Journey So Far阅读笔记
    Big Data Opportunities and Challenges(by周志华)论文要点
    spark常用算子总结
    使用Faster R-CNN做目标检测
    Oracle 性能调优 SQL_TRACE
    Oracle 性能调优 10053事件
  • 原文地址:https://www.cnblogs.com/Magicam/p/1816760.html
Copyright © 2011-2022 走看看