Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Sortable: group</title>
  <!-- Sortable.js -->
  <script src="http://rubaxa.github.io/Sortable/Sortable.js"></script>
  
</head>
<body>
  
  <ul id="users">
    <li>Оля</li>
    <li>Владимир</li>
    <li>Алина</li>
    <li>Степан</li>
  </ul>
  
</body>
</html>
 
ul {
  list-style: none;
  padding: 0;
}
li {
  background: #eee;
  margin: 1px;
  padding: 10px 15px;
  cursor: move;
  border-radius: 5px;
}
.sortable-ghost {
  opacity: .3;
  background: #f60;
}
#listC {
  border: 2px dashed #f60;
  min-height: 100px
}
 
Sortable.create(users, {
  store: {
    // Получение сортировки (вызывается при инициализации)
    get: function (sortable) {
      var order = localStorage.getItem(sortable.options.group);
      return order ? order.split('|') : [];
    },
    // Сохранение сортировки (вызывается каждый раз при её изменении)
    set: function (sortable) {
      var order = sortable.toArray();
      localStorage.setItem(sortable.options.group, order.join('|'));
    }
  }
});
Output

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

Dismiss x
public
Bin info
RubaXapro
0viewers