This is my function to go through images:
var src = event.target.src;
popupImageElem.src = (src);
//popupImageElem.src = src.replace('/thumb/','/big/');
TweenLite.to([overlayElem, popupElem], .5, {opacity: 1, visibility: 'visible'});
$(document).on('click','.left-button',(e) => {
var srcPrev = this.viewModel.getPrevThumbnailBySrc(popupImageElem.src);
popupImageElem.src = (srcPrev);
//popupImageElem.src = srcPrev.replace('/thumb/','/big/');
});
$(document).on('click','.right-button',(e) => {
var srcNext = this.viewModel.getNextThumbnailBySrc(popupImageElem.src);
popupImageElem.src = (srcNext);
//popupImageElem.src = srcNext.replace('/thumb/','/big/');
});
I want to change the image src /thumb/ to /big/ when you click next but it has to go back to /thumb/ again when you go to the next image and when on the next image it should change /temp/ to /big/ again.
if i unquote the commented code it replaces it but doesn't change it back so it wont be finding the next image since that works on url which contains /thumb/