Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<link href="https://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" rel="stylesheet" type="text/css" />
<script src="https://code.jquery.com/jquery-1.11.3.js"></script>
<script src="https://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
<div id="main">
  <div class="other" style="height:30px;  background:green">drag me</div>
    <div style="height:30px; background-color:yellow;" class="bnr">Banner</div>
    <div style="height:30px; background-color:yellow;" class="bnr">Banner2</div>
    <div style="height:30px; background-color:yellow;" class="bnr">Banner3</div>
</div>
</body>
</html>
 
$(".other").draggable({
   helper: 'clone'
});
$('.bnr').droppable({
            over: function (event, ui) {
              $('.placeholder').remove();
              $('<div style="height:30px; background-color:light-yellow;" class="placeholder"></div>').insertAfter(this);
            },
            out: function (event, ui) {
              
            },
            drop: function (event, ui) {
$('.placeholder').remove();            $(".other").insertAfter(this);  
            }
        });
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