discussion, gear, and photography journal
Quality Camera Sales Australia
As a regular user of Google Reader (Google's web-based RSS reader), I've become used to the keyboard shortcuts it supports to speed up navigation.
(If you use Google Reader, and were not aware of the keyboard shortcuts, hit "shift-?" in Google Reader to view the complete list of valid shortcuts.)

I decided to implement something similar in my photo gallery, to allow keyboard shortcuts to be used to navigate through all photos in a gallery.

Some quick Googling turned up plenty of sample javascript code for implementing this functionality. I ended up using sample code from a page titled Handling Keyboard Shortcuts in JavaScript.

After a bit of coding, my photo gallery now supports the following keyboard shortcuts when viewing the contents of a gallery:

j    next image
k    previous image
shift-j    next page
shift-k    previous page

These use of the j and k shortcut keys is similar to that in Google Reader, and is very familiar to me, as j and k are used in vi (a linux text editor) for moving to the next and previous lines.
If you enjoyed this post, then subscribe to my RSS feed,
or subscribe by email to get updates directly in your inbox.
Leave a comment:
Name:
Email address (required):  (will not be published)
URL (optional):
Comments
(no HTML allowed,
some BBcode allowed):
BBcode allowed in comments:
[b]bold[/b]
[i]italics[/b]
[url=http://server/path]link name[/url]
[img]http://server/path/image.jpg[/img]
  
Note that comments are moderated, and will not appear immediately.
Please do not include your URL in the comment text, and please use your personal name or initials and not your business name, as that comes across as spam.
Quality Camera Sales Australia
advertise here?
HostGator webhosting
chromasia Photoshop tutorials

B and H B andH
martybugs.net