Skip to content

Commit

Permalink
Update main.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SWizzard779 committed Mar 29, 2024
1 parent e5f4b04 commit 95f6564
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ async function handleSubmit(event) {
const markup = renderElements(images);
gallery.innerHTML = markup;

let gallerySlider = new SimpleLightbox('.gallery a', {
captionDelay: 250,
captionsData: 'alt',
}).refresh()
initializeSlider()

showLoadBtn()
}
Expand Down Expand Up @@ -94,6 +91,7 @@ async function handleMore(event) {
const newImages = await getPictures(inputValue, page)
const markup = renderElements(newImages);
gallery.insertAdjacentHTML('beforeend', markup)
initializeSlider()
myScroll()
hideLoader()

Expand Down Expand Up @@ -152,3 +150,10 @@ function myScroll() {
})
}

function initializeSlider(){
let gallerySlider = new SimpleLightbox('.gallery a', {
captionDelay: 250,
captionsData: 'alt',
}).refresh()
}

0 comments on commit 95f6564

Please sign in to comment.