[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

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

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


Generated: Fri Apr 26 01:00:03 2024 Cross-referenced by PHPXref 0.7.1