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