window.onload = function() { // mobiles Gerät if ("ontouchstart" in document.getElementById("stripe1")) { var objList = document.getElementsByClassName("draggable"); for(i=0;i
html, body { margin: 0px; padding: 0px; background-color: black; } .draggable { position:absolute; width: 100px; height: 100px; z-index: -1; } .draggable:hover { cursor: grab; } .draggable:active { cursor: grabbing; z-index: 1; } #stripe1 { left: 300px; top: 100px; background-color: red; } #stripe2 { left: 50px; top: 60px; background-color: blue; } #stripe3 { left: 100px; top: 200px; background-color: green; }