Skip to content

Instantly share code, notes, and snippets.

Created January 27, 2017 12:40
Show Gist options
  • Save anonymous/eed2d2ed1c616a962f0d6a46b14a90c1 to your computer and use it in GitHub Desktop.
Save anonymous/eed2d2ed1c616a962f0d6a46b14a90c1 to your computer and use it in GitHub Desktop.
SRBL // source http://jsbin.com/linuriv
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>SRBL</title>
<script src="http://rubaxa.github.io/Sortable/Sortable.js"></script>
</head>
<body>
<div class="container">
<div id="multi" style="margin-left: 30px">
<div><div data-force="5" class="layer title title_xl">Multi</div></div>
<div class="layer tile" data-force="30">
<div class="tile__name">Group A</div>
<div class="tile__list">
<img src="http://rubaxa.github.io/Sortable/st/face-01.jpg"/><!--
--><img src="http://rubaxa.github.io/Sortable/st/face-02.jpg"/><!--
--><img src="http://rubaxa.github.io/Sortable/st/face-03.jpg"/><!--
--><img src="http://rubaxa.github.io/Sortable/st/face-04.jpg"/>
</div>
</div>
<div class="layer tile" data-force="25">
<div class="tile__name">Group B</div>
<div class="tile__list">
<img src="http://rubaxa.github.io/Sortable/st/face-05.jpg"/><!--
--><img src="http://rubaxa.github.io/Sortable/st/face-06.jpg"/><!--
--><img src="http://rubaxa.github.io/Sortable/st/face-07.jpg"/>
</div>
</div>
<div class="layer tile" data-force="20">
<div class="tile__name">Group C</div>
<div class="tile__list">
<img src="http://rubaxa.github.io/Sortable/st/face-08.jpg"/><!--
--><img src="http://rubaxa.github.io/Sortable/st/face-09.jpg"/>
</div>
</div>
</div>
</div>
<script id="jsbin-javascript">
var byId = function (id) {
return document.getElementById(id);
}
function run() {
// Multi groups
Sortable.create(byId('multi'), {
animation: 150,
draggable: '.tile',
handle: '.tile__name'
});
[].forEach.call(byId('multi').getElementsByClassName('tile__list'), function (el){
Sortable.create(el, {
group: 'photo',
animation: 150
});
});
}
run();
</script>
<script id="jsbin-source-javascript" type="text/javascript">var byId = function (id) {
return document.getElementById(id);
}
function run() {
// Multi groups
Sortable.create(byId('multi'), {
animation: 150,
draggable: '.tile',
handle: '.tile__name'
});
[].forEach.call(byId('multi').getElementsByClassName('tile__list'), function (el){
Sortable.create(el, {
group: 'photo',
animation: 150
});
});
}
run();</script></body>
</html>
var byId = function (id) {
return document.getElementById(id);
}
function run() {
// Multi groups
Sortable.create(byId('multi'), {
animation: 150,
draggable: '.tile',
handle: '.tile__name'
});
[].forEach.call(byId('multi').getElementsByClassName('tile__list'), function (el){
Sortable.create(el, {
group: 'photo',
animation: 150
});
});
}
run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment