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;
|
|
|
|
if ( e.which == 37 ) { // Left arrow key code
|
|
|
|
url = $( '.previous-image a' ).attr( 'href' );
|
|
|
|
}
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
} );
|