<style>
.hot {
border: 1px dashed gray;
padding: 5px;
height: 100px;
width: 100px;
cursor: pointer;
}
</style>
<div class="hot" id="auth"></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script>
$(function() {
var client;
var shiftY;
$('#auth').mousedown(function() {
client = true;
shiftY = event.clientY - ( $('#auth').offset().top - $(window).scrollTop() );
});
$('body').mouseup(function() {
client = false;
}).mousemove(function(event) {
var clientCoords = event.clientY - shiftY;
if (client == true) {
$('#auth').css({
marginTop: clientCoords
});
}
});
});
</script>