Pass the index of the new slide to before and after callbacks.