Spec-Zone.ru › jQuery UI

jQuery.ui.keyCode

jQuery.ui.keyCode

Description: A mapping of key code descriptions to their numeric values.

  • jQuery.ui.keyCode

    • BACKSPACE
      Type: Integer
    • COMMA
      Type: Integer
    • DELETE
      Type: Integer
    • DOWN
      Type: Integer
    • END
      Type: Integer
    • ENTER
      Type: Integer
    • ESCAPE
      Type: Integer
    • HOME
      Type: Integer
    • LEFT
      Type: Integer
    • PAGE_DOWN
      Type: Integer
    • PAGE_UP
      Type: Integer
    • PERIOD
      Type: Integer
    • RIGHT
      Type: Integer
    • SPACE
      Type: Integer
    • TAB
      Type: Integer
    • UP
      Type: Integer

Example:

Test for arrow key presses.

$( document ).on( "keydown", function( event ) {
  switch( event.keyCode ) {
    case $.ui.keyCode.LEFT:
      console.log( "left" );
      break;
    case $.ui.keyCode.RIGHT:
      console.log( "right" );
      break;
    case $.ui.keyCode.UP:
      console.log( "up" );
      break;
    case $.ui.keyCode.DOWN:
      console.log( "down" );
      break;
  }
});

© The jQuery Foundation and other contributors
Licensed under the MIT License.
https://api.jqueryui.com/jQuery.ui.keyCode

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API