smoothScrolling option can now take a function.