var inxscroller = $('.scrollbar-1') var scroller = inxscroller.children().children() function scrollertransitionstart(){ scroller.stop() scroller.animate({ top: scroller.height() }, ibspeed / 2, 'easeinoutcubic', function () { scroller.css('top', -scroller.height() + 'px') }) } function scrollertransitionend(){ scroller.animate({ top: 0 }, ibdelay, 'easeinoutcubic') }