Hello all,
I have done a small code to change to the next or the previous page on
a photo-gallery when the user press on the left or the right arrow.
My problem is that work fine on FF and Opera but not on IE and Chrome/
Safary. So I assume than I have done something wrong.

My code looks like that:

Event.observe(window, 'load', function() {
  Event.observe(document, 'keypress', function(event){
    if(event.keyCode == Event.KEY_LEFT) {
      if(current_page != 1) {
        previousPage();
      }
    }

    if(event.keyCode == Event.KEY_RIGHT) {
      if(current_page < total_page) {
        nextPage();
      }
    }
  });
});

Thank you for any help.
Samuel

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to