Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!--
  Created using http://jsbin.com
  Source can be edited via http://jsbin.com/ugola/edit
-->
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<title>Sandbox</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { background-color: #fff; font: 16px Helvetica, Arial; color: #000; }
</style>
</head>
<body>
<style type="text/css">
    ul.helper, #sortable1, #sortable2 { list-style-type: none; margin: 0; padding: 0; float: left; margin-right: 10px; }
    #helperItem,#sortable1 li, #sortable2 li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 120px; }
    div.ui-dialog {z-index:0}
  #helperItem{/*visibility:hidden;*}
    ul.helper li, #newHelper{z-index:9999;}
    </style>
    <script type="text/javascript">
    $(function() {
        $("#sortable1, #sortable2").sortable({
            connectWith: '.connectedSortable',
            helper : getHelper,
            zIndex : 99999, 
            start: function(event, ui){
                ui.helper.text(ui.item.text());
            }
        }).disableSelection();
        
        $("#dialog").dialog();
        $("#sortable2 li").draggable();
      
        function getHelper(){
            var $helper = $('#helperItem').clone().attr('id','newHelper').addClass('helperItem');
          
            if (! $helper.parent().is('ul.helper') ){
                $helper.appendTo('ul.helper');
            }
          
            $helper.show();
            return $helper;
        }
        
    });
    </script>
<ul class="helper" class="connectedSortable">
    <li id="helperItem" class="ui-state-default">helper li item</div>
</ul>
<div class="demo">
<div id="dialog" title="Basic dialog">
    <ul id="sortable1" class="connectedSortable">
    <li class="ui-state-default">Item 1</li>
    <li class="ui-state-default">Item 2</li>
    <li class="ui-state-default">Item 3</li>
    <li class="ui-state-default">Item 4</li>
    <li class="ui-state-default">Item 5</li>
</ul>
</div>
<ul id="sortable2" class="connectedSortable">
    <li class="ui-state-highlight">Item 1</li>
    <li class="ui-state-highlight">Item 2</li>
    <li class="ui-state-highlight">Item 3</li>
    <li class="ui-state-highlight">Item 4</li>
    <li class="ui-state-highlight">Item 5</li>
</ul>
</div><!-- End demo -->
<div class="demo-description">
</div>
</html>
Output

This bin was created anonymously and its free preview time has expired (learn why). — Get a free unrestricted account

Dismiss x
public
Bin info
anonymouspro
0viewers