if (startPos.y > currentPos.y) {
            $box.css('top', currentPos.y + 'px');
        } else {
            $box.css('top', startPos.y + 'px');
        }