A multifunctional soft keyboard plugin based on jquery _jquery

Source: Internet
Author: User
Support the query function of the keyboard and simple keyboard, keyboard style completely in the independent CSS file definition, you can beautify themselves.

(Support from the query of the soft keyboard)

(Simple software disk)

Default parameters for Plug-ins
Copy Code code as follows:

Jquery.fn.softkeyboard.defaults = {
Names: {
_DELBTN: "Skbdel",
_CLEARBTN: "Skbclear",
_QUERYBTN: "Skbquery",
_CLOSEBTN: "Skbclose",
_LETTERBTN: "Skbbtn",
_maindiv: "Skbsoftkeyboard",
_leftdiv: "Skbleft",
_rightdiv: "Skbright",
_keyboarddiv: "Skbkeyboard",
_operationdiv: "Skboperation",
_codetxt: "Skbcode",
_resultsselect: "Skbresults",
_postparamcode: "Sfbcode",
_clearbtnviewname: "Clear",
_delbtnviewname: "Delete",
_querybtnviewname: "Query",
_closebtnviewname: "Close"
},//plugin related element naming
Listmultiple:true,//select whether to unfold
Simplekeyboard:true,//whether to display uppercase letters
Onlykeyboard:false,//whether with query function
Maxlength:null,//maximum length to enter
Requestdataurl:null,//Post address of the query data
Oncompleted:function (data) {},//On completion at this time
Onkeydown:function (data) {}//Key when starting this event
};

How to use Plug-ins
How to use
Copy Code code as follows:

<link href= "Softkeyboard.css" rel= "stylesheet" type= "Text/css"/>
<script src= "Jquery-1.6.2.js" type= "Text/javascript" ></script>
<script src= "Jquery.softkeyboard.js" type= "Text/javascript" ></script>

Add a text box to the page use Method 2
<input type= "text" class= "Querytxt"/>
Use plugins for text boxes that are querytxt for class
Copy Code code as follows:

<script type= "Text/javascript" >
$ (". Querytxt"). SoftKeyboard ()
</script>

Change related parameters
Copy Code code as follows:

$ (". Querytxt"). SoftKeyboard ({
Simplekeyboard:true,
Listmultiple:true,
Maxlength:10,
Onkeydown:function (d) {alert (d)},
Requestdataurl: "Getdata.ashx",
Onlykeyboard:true
})

The JSON data format returned by GETDATA.ASHX is similar to the following
Copy Code code as follows:

[{code: DL, Name: "Dalian"},{code: "DT", Name: "Datong"},{code: "DL", Name: "Dali"}]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.