If our addon doesn't have this kind of option, it's hard for me to give you the custom code, which is a kind of customization.
Maybe consider using the Slideshow module which has more options built-in.
It would be faster to use, for example, SmartSlider3 (nextend).