Why would you need to do this…
It is not clear to me what you setup is or layout is so it is hard to give an answer.
For example what is sliding and what is changing when a button is clicked.
We could have a slide show that when I click an arrow, a new image slides into view and the old image slides out of view.
There is an slide counter that displays #n of #n number of images that will be updated after each slide.
When do slide show runs to one end The advance arrow for that side becomes un responsive until the slide show is advanced in the other direction first.
There are also number buttons for each slide that can be clicked to advance directly to that slide thus skipping any slides in between.
Please post a project that shows us what you are doing…