Changeset 26226
- Timestamp:
- 11/15/2013 09:18:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/js/keyboard-image-navigation.js
r25995 r26226 1 jQuery( document ).ready(function( $ ) {2 $( document ). keydown(function( e ) {1 jQuery( function( $ ) { 2 $( document ).on( 'keydown.twentyfourteen', function( e ) { 3 3 var url = false; 4 if ( e.which === 37 ) { // Left arrow key code 4 5 // Left arrow key code. 6 if ( e.which === 37 ) { 5 7 url = $( '.previous-image a' ).attr( 'href' ); 6 } 7 else if ( e.which === 39 ) { // Right arrow key code 8 9 // Right arrow key code. 10 } else if ( e.which === 39 ) { 8 11 url = $( '.entry-attachment a' ).attr( 'href' ); 9 12 } 13 10 14 if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) { 11 15 window.location = url;
Note: See TracChangeset
for help on using the changeset viewer.