[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

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


Generated: Sun Dec 22 01:00:02 2024 Cross-referenced by PHPXref 0.7.1