mirror of
https://github.com/prise6/anywhere
synced 2024-05-26 22:22:12 +02:00
drag & drop script
This commit is contained in:
parent
f7c234055d
commit
eb3574e98f
18
index.html
18
index.html
|
@ -51,6 +51,24 @@
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<script src="https://code.getmdl.io/1.1.3/material.min.js"></script>
|
<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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in a new issue