`Math.abs` just does absolute value, which means you don't need to check for negative scroll distance below.

```js
var scrollDistance = Math.abs($(elem).offset().top - $document.scrollTop());
if (scrollDistance > 1200) {
    scrollTime = 2500;
}
```