$('.parallax').stellar({ hideDistantElements: 'true' });
$(function () { // use UI arrows in page content to control scrolling var scrolling = false;
$('.scroll-arrows').on('mousedown', 'div', function (evt) { scrolling = true; startScrolling($('.parallax'), 75, evt.target.id); }).on('mouseup', function () { scrolling = false; });
function startScrolling(obj, spd, btn) { var travel = (btn.indexOf('left') > -1) ? '-=' + spd + 'px' : '+=' + spd + 'px'; if (!scrolling) { obj.stop(); } else { // recursively call startScrolling while mouse is pressed obj.animate({ "scrollLeft": travel }, "fast", function () { if (scrolling) { startScrolling(obj, spd, btn); } }); } } });