When you declare a DOCTYPE
, your page tells the browser to render the page strictly. If you simply omit the declaration, it will instead use the so called Quirksmode.
So obviously your code does not comply with HTML 5 strict-mode which is used when you add <!DOCTYPE html>
.
I hope this is the advice you needed.
EDIT:
I found what causes your script from working. In your drag
-Event: simply replace your old lines with:
imgEl.style.top = y + parseFloat(event.gesture.deltaY)+'px';
imgEl.style.left = x + parseFloat(event.gesture.deltaX)+'px';
The strict mode requires you to return numeric values that are followed by a px
just like you are defining it in your style attribute: style="top:0px; left:0px;"
.