Customize jQuery On-Screen Keyboard

て烟熏妆下的殇ゞ 提交于 2019-12-08 10:03:07

问题


I need to display a virtual keyboard in some pages on my web-app, so I found this beautiful jQuery On-Screen Keyboard: http://www.jquery4u.com/demos/onscreenkeyboard/

You can download it from Github: https://github.com/sdeering/onscreenkeyboard/archive/master.zip

I need help to customize it, initially I thought that change CSS will do but turn out it need to be changed on some Jquery functions, I tried removing and changing the order of some functions but didn't work, I dont know Jquery so I am stuck.

For example here are some modifications I need to archive:

  • Display upper key by default (right now it displays lower key) and don't give them the option key to turn on lower key.
  • Remove Enter key

Can someone help me to figure out those 2 modifications above and give a brief explanation so I can get started and understand how to customize a key, I need a lot of modifications.


回答1:


Display upper key by default

Add this code to your HTML document (AFTER it loads jquery, which it does on line 113) What this does is run the changeToCapitalLetter function, which will change the keyboard to the capital keys.

<script> $(document).ready(function() { jsKeyboard.changeToCapitalLetter(); }); </script>

Remove Enter key and don't give them the option key to turn on lower key.

replace lines 177 and 179 with the following code

{ value: "", isChar: "false", buttonClass: "button button_empty", keyClass: "key key_empty" },

  



来源:https://stackoverflow.com/questions/29681835/customize-jquery-on-screen-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!