Parcourir la source

Add documentation for new `animatefinished` event.

pull/668/merge
Matthew Petroff il y a 6 ans
Parent
révision
6d8a19991d
2 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. +6
    -0
      doc/events.md
  2. +1
    -1
      src/js/pannellum.js

+ 6
- 0
doc/events.md Voir le fichier

@@ -27,6 +27,12 @@ If a scene transition fade interval is specified, this event is fired when the
fading is completed after changing scenes.


## `animatefinished`

Fired when any movements / animations finish, i.e. when the renderer stops
rendering new frames. Passes final pitch, yaw, and HFOV values to handler.


## `error`

Fired when an error occured. The error message string is passed to the


+ 1
- 1
src/js/pannellum.js Voir le fichier

@@ -1372,7 +1372,7 @@ function animate() {
} else if (renderer && (renderer.isLoading() || (config.dynamic === true && update))) {
requestAnimationFrame(animate);
} else {
fireEvent('animateFinished', {pitch: _this.getPitch(), yaw: _this.getYaw(), hfov: _this.getHfov()});
fireEvent('animatefinished', {pitch: _this.getPitch(), yaw: _this.getYaw(), hfov: _this.getHfov()});
animating = false;
prevTime = undefined;
var autoRotateStartTime = config.autoRotateInactivityDelay -


Chargement…
Annuler
Enregistrer