Skip to content

Commit

Permalink
wait page is load
Browse files Browse the repository at this point in the history
  • Loading branch information
armandsalle committed Jan 15, 2021
1 parent 5aabd1d commit 4e83779
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/autoInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ class AutoCreateSlider {
}

const autoInit = (): CreateSlider[] => {
const slidersList = new AutoCreateSlider()
let slidersList

window.addEventListener('load', () => {
slidersList = new AutoCreateSlider()
})

return slidersList.sliders
}

Expand Down

0 comments on commit 4e83779

Please sign in to comment.