Add hotpot navigation and slideshow
Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
let slideShowInterval = null
|
||||
|
||||
/**
|
||||
* Sets listener and attributes on model-viewer to
|
||||
* allow for click registering of a new hotspot
|
||||
@@ -151,5 +153,10 @@ prevAnnotation = function(mView) {
|
||||
* @return {intervalID} ID of the created interval timer
|
||||
*/
|
||||
slideshowAnnotations = function(mView, slideDuration = 5000) {
|
||||
return setInterval(nextAnnotation, slideDuration, mView)
|
||||
if (slideShowInterval) {
|
||||
clearInterval(slideShowInterval)
|
||||
} else {
|
||||
nextAnnotation(mView)
|
||||
slideShowInterval = setInterval(nextAnnotation, slideDuration, mView)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user