• 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;
                }
  • 相关阅读:
    asp.net 读取Excel文档
    ASP.NET实现IE下禁用浏览器后退按钮办法
    asp.net 追加文本(追加写入记事本)
    Sql Server中charindex、patindex的区别
    css3 简单动画
    ie6下兼容问题
    IE6下 input 背景图滚动问题及标签规范
    css2---必须学的经典---定位问题
    EF 用CallContext上下文管理
    EF查询分页
  • 原文地址:https://www.cnblogs.com/Magicam/p/1816760.html
Copyright © 2020-2023  润新知