This repository has been archived on 2020-05-08. You can view files and clone it, but cannot push or open issues or pull requests.
2012-02-02 20:49:40 +00:00
|
|
|
jQuery( document ).ready( function( $ ) {
|
|
|
|
$( document ).keydown( function( e ) {
|
|
|
|
var url = false;
|
2013-07-14 06:38:08 +00:00
|
|
|
if ( e.which === 37 ) { // Left arrow key code
|
2012-02-02 20:49:40 +00:00
|
|
|
url = $( '.previous-image a' ).attr( 'href' );
|
|
|
|
}
|
2013-07-14 06:38:08 +00:00
|
|
|
else if ( e.which === 39 ) { // Right arrow key code
|
2012-02-03 14:02:28 +00:00
|
|
|
url = $( '.entry-attachment a' ).attr( 'href' );
|
2012-02-02 20:49:40 +00:00
|
|
|
}
|
|
|
|
if ( url && ( !$( 'textarea, input' ).is( ':focus' ) ) ) {
|
|
|
|
window.location = url;
|
|
|
|
}
|
|
|
|
} );
|
2013-07-14 06:38:08 +00:00
|
|
|
} );
|