Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
} else {
options.index = parseInt(index, 10)
}
// exit if index not found
if (isNaN(options.index)) {
return
}
if (disableAnimation) {
options.showAnimationDuration = 0
}
// Pass data to PhotoSwipe and initialize it
gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, items, options)
gallery.init()
// gallery.bg.style.backgroundColor = gallery.currItem.bgColor
// gallery.listen('beforeChange', () => {
// gallery.bg.style.backgroundColor = gallery.currItem.bgColor
// })
}