Sha256: 7e4c7a8bf785a225ff4a11a0d38bc9ddf5c99b61f789828f04e37b5b4667b9be

Contents?: true

Size: 416 Bytes

Versions: 2

Compression:

Stored size: 416 Bytes

Contents

jQuery( document ).ready( function( $ ) {
	$( document ).keydown( function( e ) {
		var url = false;
		if ( e.which == 37 ) {  // Left arrow key code
			url = $( '.previous-image a' ).attr( 'href' );
		}
		else if ( e.which == 39 ) {  // Right arrow key code
			url = $( '.entry-attachment a' ).attr( 'href' );
		}
		if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) {
			window.location = url;
		}
	} );
} );

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wordpress-starter-0.3 templates/starter/javascripts/keyboard-image-navigation.js
wordpress-starter-0.2 templates/starter/javascripts/keyboard-image-navigation.js