Skip to content

Add callback feature

Compare
Choose a tag to compare
@shisama shisama released this 24 Aug 01:54
· 21 commits to master since this release

Callback example:

 onChangeFullScreen = function() {
   const element = document.getElementById('something');
   toggleFullscreen(element, function(isFullScreen) {
     if (isFullScreen) {
       // any process in fullscreen mode
       // e.g.document.addEventListener('keydown', this.keydownEvent);
     } else {
       // any process in non-fullscreen mode
       // e.g.document.removeEventListener('keydown', this.keydownEvent);
     }
   });
 };