function moveToImageInSlider(imgIndex) {
  // console.log("Slider moved to", imgIndex);
  updateUserInfo(imgIndex);
  slider.imageContainer.style.setProperty(
    "transform",
    `translateX(${-1 * slider.frameWidth * imgIndex}px)`
  );

  function updateUserInfo(currentImgIndex) {
    let userInfoAnchor = document.querySelector("#gallery_info_div a");
    let currentImage = slider.images[currentImgIndex];
    userInfoAnchor.innerHTML = currentImage.user.name;
    userInfoAnchor.setAttribute("href", currentImage.user.link);
  }
}
/**
 * Shows the specified image into the slider
 * @function moveToImageInSlider
 * @param {number} imgIndex Index of the image to show
 */
Shows the specified image into the slider
@function moveToImageInSlider
@param {number} imgIndex Index of the image to show
Shows the specified image into the slider @function moveToImageInSlider @param { number } imgIndex Index of the image to show
function moveToImageInSlider(imgIndex) {
  updateUserInfo(imgIndex);
  slider.imageContainer.style.setProperty(
    "transform",
    `translateX(${-1 * slider.frameWidth * imgIndex}px)`
  );
  function updateUserInfo(currentImgIndex) {
    let userInfoAnchor = document.querySelector("#gallery_info_div a");
    let currentImage = slider.images[currentImgIndex];
    userInfoAnchor.innerHTML = currentImage.user.name;
    userInfoAnchor.setAttribute("href", currentImage.user.link);
  }
}
function moveToImageInSlider ( imgIndex ) { updateUserInfo ( imgIndex ) ; slider . imageContainer . style . setProperty ( "transform" , ` ${ - 1 * slider . frameWidth * imgIndex } ` ) ; function updateUserInfo ( currentImgIndex ) { let userInfoAnchor = document . querySelector ( "#gallery_info_div a" ) ; let currentImage = slider . images [ currentImgIndex ] ; userInfoAnchor . innerHTML = currentImage . user . name ; userInfoAnchor . setAttribute ( "href" , currentImage . user . link ) ; } }
Shows the specified image into the slider
 @function moveToImageInSlider
 @param {number} imgIndex Index of the image to show
Shows the specified image into the slider @function moveToImageInSlider @param { number } imgIndex Index of the image to show
// console.log("Slider moved to", imgIndex);