Last active
          August 29, 2015 14:27 
        
      - 
      
- 
        Save keeganbrown/3a85977a76d11d6c2f8d to your computer and use it in GitHub Desktop. 
Revisions
- 
        keeganbrown renamed this gist Aug 23, 2015 . 1 changed file with 20 additions and 3 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ $(document).off('mousewheel'); var isScrolling = null; $(document).on('mousewheel', function (e) { if ( e.deltaY != 0 && Math.abs(e.deltaY) > 5 ) { @@ -10,20 +12,35 @@ $(document).on('mousewheel', function (e) { master.seek(_label); _label = master.getLabelBefore(); } if ( _label == 'breakpoint1' ) { master.seek(_label); _label = master.getLabelBefore(); } while ( !!_label && !_label.match(/breakpoint|start/gi) ) { master.seek(_label); _label = master.getLabelBefore(); } console.log(_label); } else if ( e.deltaY < 0 ) { _label = master.getLabelAfter(); if ( !!_label && !_label.match(/breakpoint|start/gi) ) { master.seek(_label); _label = master.getLabelAfter(); } } if ( !!_label ) { master.pause(); master.seek(_label); if (_label != 'breakpoint1') { master.play(); } isScrolling = setTimeout( function () { isScrolling = null; master.play(); }, 1000 ); } } } 
- 
        keeganbrown renamed this gist Aug 22, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewingFile renamed without changes.
- 
        keeganbrown created this gist Aug 22, 2015 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ var isScrolling = null; $(document).on('mousewheel', function (e) { if ( e.deltaY != 0 && Math.abs(e.deltaY) > 5 ) { if ( !isScrolling ) { $('video').each( function (i, ele) { ele.pause() } ); var _label = ''; if ( e.deltaY > 0 ) { _label = master.getLabelBefore(); if ( !!_label ) { master.seek(_label); _label = master.getLabelBefore(); } } else if ( e.deltaY < 0 ) { _label = master.getLabelAfter(); } console.log(_label); if ( !!_label ) { master.pause(); master.seek(_label); master.play(); isScrolling = setTimeout( function () { isScrolling = null; master.play(); }, 150 ); } } } //console.log(e); });