[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-content/themes/twentysixteen/js/ -> keyboard-image-navigation.js (source)

   1  /**
   2   * Twenty Sixteen keyboard support for image navigation.
   3   */
   4  
   5  ( function( $ ) {
   6      $( document ).on( 'keydown.twentysixteen', function( e ) {
   7          var url = false;
   8  
   9          // Left arrow key code.
  10          if ( 37 === e.which ) {
  11              url = $( '.nav-previous a' ).attr( 'href' );
  12  
  13          // Right arrow key code.
  14          } else if ( 39 === e.which ) {
  15              url = $( '.nav-next a' ).attr( 'href' );
  16  
  17          // Other key code.
  18          } else {
  19              return;
  20          }
  21  
  22          if ( url && ! $( 'textarea, input' ).is( ':focus' ) ) {
  23              window.location = url;
  24          }
  25      } );
  26  } )( jQuery );


Generated : Thu Mar 28 08:20:01 2024 Cross-referenced by PHPXref