Jquery-based multi-function keyboard plug-in

Source: Internet
Author: User

Supports the query function keyboard and a simple soft keyboard. The keyboard style is completely defined in an independent css file and can be beautified by yourself.

(Supports the soft keyboard from the query)

(Simple software disk)

Default parameters of the plug-in
Copy codeThe Code is 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"
}, // Plug-in related element naming
Listmultiple: true, // select whether to expand
Simplekeyboard: true, // whether to display uppercase letters
Onlykeyboard: false, // whether the query function is provided
Maxlength: null, // maximum length that can be entered
Requestdataurl: null, // The post address of the queried data
Oncompleted: function (data) {}, // set this time when the task is completed
Onkeydown: function (data) {}// this event is triggered when you press the button
};

Use of plug-ins
Usage
Copy codeThe Code is 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. method 2
<Input type = "text" class = "querytxt"/>
Use the plug-in for the text box whose class is querytxt
Copy codeThe Code is as follows:
<Script type = "text/javascript">
$ (". Querytxt"). softkeyboard ()
</Script>

Change Related Parameters
Copy codeThe Code is 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 codeThe Code is 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.