img-slideshow
A custom element for displaying a transitioning slideshow of images.
img-slideshow
Attributes
src
String JSON array of URLs to use as image sources.
src='["https://picsum.photos/id/100/200/300", "https://picsum.photos/id/101/200/300", "https://picsum.photos/id/102/200/300"]'
base-url
Optionally specify a common root for each URL in src
.
is equivalent to
interval
Set the time between slide transitions (ms).
Defaults to 2000
.
Events
"slidetransition"
Emitted on transitioning to the next slide.
Handler callback has signature
void
Methods
nextSlide(): void
Advances the slideshow to the next slide, emmiting event "slidetransition"
on transition.
prevSlide(): void
Moves the slideshow back to show the previous slide.
goto(slideIndex: number): void
Advances the slideshow to show the ith slide, using the indices of the src
array starting from 0
.
Negative indices will count back from the last slide.
stop(): void
Stops the slideshow.
start(): void
(Re)starts the slideshow.