A Pen by Brian Redfern on CodePen.
Last active
December 7, 2016 07:40
-
-
Save bredfern/e2b96abfc43a31d49ba759cf4d75c7f2 to your computer and use it in GitHub Desktop.
Sortable Circle on the end of a Div
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="content"> | |
<ul id="tasks"> | |
<li> | |
<div class="outer-circle"> | |
<div class="inner-circle orange-bg"> | |
<span class="inside-content"></span> | |
</div> | |
Broken Iphone <i class="material-icons right gray">rss_feed</i> | |
</div> | |
</li> | |
<li> | |
<div class="outer-circle"> | |
<div class="inner-circle mango-bg"> | |
<span class="inside-content"></span> | |
</div> | |
Hard Drive Ruined <i class="material-icons right gray">rss_feed</i> | |
</div> | |
</li> | |
<li> | |
<div class="outer-circle blue-bg"> | |
<div class="inner-circle algae-bg"> | |
<span class="inside-content"></span> | |
</div> | |
No DVD <i class="material-icons right gray">rss_feed</i> | |
</div> | |
</li> | |
</ul> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//https://github.com/RubaXa/Sortable | |
Sortable.create(tasks, { | |
group: 'tasks', | |
animation: 100, | |
// Element dragging ended | |
onEnd: function (/**Event*/evt) { | |
alert(evt.newIndex); | |
evt.oldIndex; // element's old index within parent | |
evt.newIndex; // element's new index within parent | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//rubaxa.github.io/Sortable/Sortable.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
width: 100% | |
margin:0px; | |
text-align: center; | |
} | |
ul { | |
list-style-type: none; | |
} | |
li { | |
margin-bottom: 10px; | |
} | |
#content { | |
width: 300px; | |
margin-left: auto; | |
margin-right: auto; | |
} | |
.outer-circle { | |
position: relative; | |
border: solid 0.5px #838283; | |
border-radius: 2.5px; | |
padding: 6px; | |
text-align: left; | |
padding-left: 20px; | |
} | |
.inner-circle { | |
position: absolute; | |
border-radius: 50%; | |
height:16px; | |
width:16px; | |
left: -8px; | |
top: 28%; | |
} | |
.orange-bg { | |
background: #ff4c2b; | |
} | |
.blue-bg { | |
background: #385a94; | |
} | |
.algae-bg { | |
background: #1cc749; | |
} | |
.mango-bg { | |
background: #ffbe2b; | |
} | |
.right{ | |
float: right; | |
} | |
.gray { | |
color: #4a4a4a; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment