I need manipulate "left" and "right" key on prototype, something li开发者_如何学Pythonke http://mangastream.com/
As simple as:
$(document).observe('keydown', function (e) {
    switch (e.keyCode) {
        case Event.KEY_LEFT:
            e.stop(); // prevent the default action, like horizontal scroll
            window.location = '/read/prev';
            break;
        case Event.KEY_RIGHT:
            e.stop();
            window.location = '/read/next';
            break;
    }
});
http://jsfiddle.net/pMts6/
Event.KEY_LEFT and Event.KEY_RIGHT are their handy constants for the numerical codes of the corresponding keys.
Read up on Prototype events at http://api.prototypejs.org/dom/Event/.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论