In the case when the picture is summarized, most likely, this is the standard behavior of browsers for elements for which the content can be dragged (dragging): images, links, selected text. These elements create an "avatar", which itself moves.

If you bring this "avatar" to the bottom of the page, then it will scroll. I suppose that browsers in such cases ignore the sources of "avatars", and work only for the "avatars" themselves. In the case of a div , a scroll happens, due to the fact that the browser assumes that there is a selection of content. Therefore, when the mouse button is clamped, he thinks that the selection has begun. And when you select the page will always scroll. This is based on my assumptions. I have not yet found that this behavior has been documented somewhere.
If you don’t need the scroll to work with the div'е , you can simply cancel the browser actions:
document.onmousemove = function(event) { tar.style.left = event.pageX - 20 + 'px'; tar.style.top = event.pageY - 20 + 'px'; return false; }
Here is an example, you can see that for a non-empty link the actions are the same as for the picture.
document.onmousedown = function(event) { var tar = event.target; if (tar.tagName != 'IMG' && tar.tagName != 'DIV' && tar.tagName != 'A') return; tar.style.position = 'absolute'; document.onmousemove = function(event) { tar.style.left = event.pageX - 20 + 'px'; tar.style.top = event.pageY - 20 + 'px'; //return false; } tar.onmouseup = function() { document.onmousemove = tar.onmouseup = null; } tar.ondragstart = function() { return false; } }
body { height: 2000px }
<div style='background: blue; width:100px; height:100px'></div> <img src="https://js.cx/drag-heroes/ball.png"> <a href="http://referencesource.microsoft.com/">Link</a> <a>Empty link</a>