Archive for the ‘Exposure how-to’s’ Category

Keyboard navigation

Navigate using your keyboard

The built in keyboard navigation in Exposure is powered by the jQuery Hotkeys Plugin by John Resig.

Here’s the full list of the currently supported actions in Exposure (more are likely to soon be added):

  • Left arrow – Previous photo
  • Right arrow – Next photo
  • Ctrl+Left arrow – Next page
  • Ctrl+Right arrow – Previous page

In version 0.4 of Exposure I introduced support for localization. This means that the texts used in Exposure can be translated to any language. In the latest download package you will find a new folder called “localization” which contains two JavaScript files, one for each additional language (currently German and Swedish). To use one of these languages instead of the default (which is English), simply include one of these language files in your HTML code:

<script src="res/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="../jquery.exposure.js?v=0.4" type="text/javascript"></script>
<script src="../localization/texts_de.js" type="text/javascript"></script>

This example is copied from the first Exposure demo. By simply adding the third line here the result will be a gallery that’s translated to German:

German example

Exposure speaking German.

Adding your own translation is also dead easy. Simply copy one of the localization JavaScript files, open it up, and change the text strings to something suitable in your own language. Save your copy, and include it in the same way that we did in the example above.

Here’s what a plain English translation would look like:

* Exposure plugin texts translated to English.
jQuery.extend(jQuery.exposure.texts, {
first : "First",
previous : "Prev",
next : "Next",
last : "Last"

…and here’s a version of the same text translated to Morse code.

* Exposure plugin texts translated to Morse code.
jQuery.extend(jQuery.exposure.texts, {
first : "..-. .. .-. ... -",
previous : ".--. .-. . ...-",
next : "-. . -..- -",
last : ".-.. .- ... -"

If you want to contribute to the Exposure project by submitting a translation for your own language send me an e-mail to