Preventing a custom slideshow section refreshing when editing slide #2 and #3

I created a custom section for a photo/video slideshow that works exactly as I wanted. all I’m unsure about right now is that when customizing the theme and editing slide text, buttons, etc.. the page refreshes to reflect the change which causes the slideshow to go back to slide #1 instead of staying at slide #3 for example. How do developers bypass that?

What I’m personally thinking is going to be based off of the class “active” which is cycled around each slide based on x interval. slides which don’t have the class active have their opacity set to 0 after a transition which serves as a way to have the slideshow effect and to also add in a fade transition animation between slides. would there be a way in liquid to state that x slide is being customized then slide x should have the class active?