if (directions.left)
        elem.scrollLeft = Math.max(0, elem.scrollLeft-this.scrollAmount);
        else if (directions.right)
        elem.scrollLeft = Math.min(elem.scrollWidth, elem.scrollLeft+this.scrollAmount);