Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery.min.js"></script>
  <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<link href="//code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.min.css" rel="stylesheet" type="text/css" />
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//code.jquery.com/ui/1.11.0/jquery-ui.min.js"></script>
  <script src="https://rawgit.com/kamens/jQuery-menu-aim/master/jquery.menu-aim.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
<div id="wrapper">
    <!-- Sidebar -->
    <div id="sidebar-wrapper">
        <div class="background"></div>
           
          
                        <ul>
                            <li class="draggable" id="header-1">
                                <img src="http://placehold.it/150x100">
                            </li>
                            <li class="draggable" id="header-2">
                                <img src="http://placehold.it/150x100">
                            </li>
                        </ul>
                    </div>
              
            
           
               
    </div>
    <!-- /#sidebar-wrapper -->
    <!-- Page Content -->
    <div id="page-content-wrapper">
        <div class="container-fluid">
            <div class="row">
                
                    <ul class="sortableList">Drag and Drop images here</ul>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
</html>
 
#sidebar-wrapper {
  width:150px;
}
#page-content-wrapper {
  
   width:800px;
   height:400px;
   border:2px solid red;
}
.sortableList li {
   width:150px;
  height:200px;
 
}
.background {width:100%; height:40px; background:red;display:none;}
 
 $(".sortableList").sortable({
     start: function(event, ui) {
       
       if (event.handleObj.namespace=="sortable")
           $('.background').show();
        },
   
   update: function(event, ui) {
       
       if (event.handleObj.namespace=="sortable")
           $('.background').hide();
        }
   
   
 });
 $(".draggable").draggable({
     connectToSortable: '.sortableList',
     cursor: 'pointer',
     helper: 'clone',
     revert: 'invalid',
     start: function (event, ui) {
         $(this).addClass('testing');
     }
 });
 $("#sidebar-wrapper").droppable({
     accept: 'li',
     drop: function (event, ui) {
         ui.helper.remove();
     }
 });
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
anonymouspro
0viewers