1
0
Fork 0
mirror of https://github.com/prise6/anywhere synced 2024-05-06 04:13:09 +02:00

drag & drop script

This commit is contained in:
raph 2016-05-02 00:18:32 +02:00
parent f7c234055d
commit eb3574e98f

View file

@ -51,6 +51,24 @@
</main>
</div>
<script src="https://code.getmdl.io/1.1.3/material.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
<script type="text/javascript">
var isDragging = false;
$("#anywhere")
.mousedown(function() {
isDragging = false;
})
.mousemove(function() {
isDragging = true;
})
.mouseup(function() {
var wasDragging = isDragging;
isDragging = false;
if (wasDragging) {
$(this).text('anywhere')
}
});
</script>
</body>
</html>