In my application I use drag&drop which I aslo want to implement on mobile devices. I was thinking about using JQuery Ui touch punch like this:
var thumb = document.createElement("img");
$(thumb).draggable({containment: "html"});
The problem is that my image is dragged only in the scope of its parent (see attached image) not on the whole page. I've tried changing containment options but the problem seems to be elsewhere.
CSS:
html, body {
height: 100%;
background: black;
margin:0; padding:0;
overflow:hidden;
}
//one parent
.dhThumbOuter {
float: left;
width: 64px;
height: 64px;
-webkit-box-shadow: 0px 0px 5px #4d4d4d;
-moz-box-shadow: 0px 0px 5px #4d4d4d;
box-shadow: 0px 0px 5px #4d4d4d;
border:solid gray 1px;
overflow: hidden;
padding: 3px;
margin-left: 3px;
font-size: smaller;
position:relative;
border : solid gray 2px;
}
//other parrent
.dhThumbImage {
background: lightgray;
padding: 0;
width: 64px;
height: 64px;
overflow: hidden;
position:absolute;
}
Javascript:
var thout = createElement("div", "dhThumbOuter dhRounded");
container.appendChild(thout);
var thinner = createElement("div", "dhThumbImage dhRounded");
thout.appendChild(thinner);
thinner.appendChild(thumb); //my image