Home >Web Front-end >JS Tutorial >jQuery on Screen Keyboard Plugin

jQuery on Screen Keyboard Plugin

Joseph Gordon-Levitt
Joseph Gordon-LevittOriginal
2025-03-04 00:55:09517browse

This jQuery on-screen keyboard plugin provides a customizable virtual keyboard for enhanced website usability. It's similar to Windows' accessibility keyboard, appearing when an input field is clicked.

jQuery on Screen Keyboard Plugin

Implementation:

  1. Download: Obtain the plugin files.
  2. Base Code: Use the provided demo.js as a starting point.
  3. Layout & Settings: Modify the keyboard layout and settings (see code examples below).
  4. CSS Styling: Customize the CSS to match your website's design.

Download & Demo Links: Download Page, Live Demo

jQuery Code Examples:

Basic QWERTY Keyboard:

$(document).ready(function(){
  $('.qwerty').keyboard({ layout: 'qwerty' });
});

Numeric Keyboard with Restrictions:

$(document).ready(function(){
  $('#num').keyboard({
    layout: 'num',
    restrictInput: true,
    preventPaste: true,
    autoAccept: true
  });
});

Typing Simulator Extension:

$(function() {
  $('.ui-keyboard-input').addTyping();
});

Keyboard Triggered by Hyperlink:

This example shows how to display the keyboard when a hyperlink is clicked, focusing a hidden input field:

$('.hiddenInput').click(function(){
  $('#hidden').trigger('focus');
  return false;
});

$('#hidden').keyboard({
  layout: 'qwerty',
  position: {
    of: $('.hiddenInput'),
    my: 'center top',
    at: 'center top'
  }
});

Remember to replace placeholder links with the actual download and demo URLs. This revised description provides a clearer and more concise explanation of the plugin's functionality and usage.

The above is the detailed content of jQuery on Screen Keyboard Plugin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn