Load images dynamically on previous or next button click using photoviewer.js

Can you please provide how to override previous and next buttons for loading each image on clicking next or previous buttons. I have provided a link below in which I need to override next and previous buttons on clicking it. I’ll provide a image source on that button click. Please help me out.

Link: https://github.com/nzbin/photoviewer

Pretty sure you don’t want to change the prev / next button behavior. If you change only the buttons, then the left / right arrow behavior will still be the original behavior.

The prev / next buttons and the left/right arrows all invoke the jump() function, which invokes the jumpTo() function. Those, I think, are what you want to change.