.offset([coordinates]) method set the coordinates of an element but only relative to the document. Then how can I set coordinates of an element but relative to
.offset([coordinates])
Use offset() function of jQuery. Here it would be:
offset()
jQuery
$container.offset({ 'left': 100, 'top': mouse.y - ( event_state.mouse_y - event_state.container_top ) });