EduardET

Untitled

May 28th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script>
  2. ( function( $ ) {
  3.   $( document ).on( 'mousewheel DOMMouseScroll', function( event ) {
  4.     if ( ( $( '.et_pb_side_nav' ).length === 0 ) || $( 'html, body' ).is( ':animated' ) ) return;
  5.     event.preventDefault();
  6.     var direction = event.originalEvent.wheelDelta || -event.originalEvent.detail;
  7.     var $position = $( '.et_pb_side_nav' ).find( '.active' );
  8.     var $target;
  9.     if( direction < 0 ) {
  10.       $target = $( $position ).parent().next();
  11.     } else {
  12.       $target = $( $position ).parent().prev();
  13.     }
  14.     if ( $( $target.length ) !== 0 ) {
  15.       $( $target ).children( 'a' ).trigger( "click" );
  16.     }
  17.   } );
  18. } )( jQuery );
  19. </script>
Advertisement
Add Comment
Please, Sign In to add comment