Open page Default popup soft keyboard, compatible with both iOS and Android

Source: Internet
Author: User

Example 1open_soft_keyboard ({input: "#username"});//Example 2open_soft_keyboard ({input: ' input[value= ""} ");/** * Open soft keyboard by default * @param options{* Input: ' #nickname '//Container node *} * @author cai Boom * @version 1.0.3 build 20151226 */function Open_soft_ke Yboard (Options) {if (Plus.os.name = = ' IOS ') {setTimeout (function () {var wv_current = Plus.webview.curr            Entwebview (). Nativeinstanceobject ();            Wv_current.pluscallmethod ({"Setkeyboarddisplayrequiresuseraction": false});        Document.queryselector (options[' input '). focus ();    }, 330); }else{//Because Android autofocus is only supported in the 4.0 version, the native.js is used to force pop-up setTimeout (function () {///when executing, you need to make the current web            View gain focus var wv_current = Plus.android.currentWebview ();            Plus.android.importClass (wv_current);            Wv_current.requestfocus ();            var Context = Plus.android.importClass ("Android.content.Context"); var Inputmethodmanager = Plus.android.importClass ("android.view.iNputmethod.            Inputmethodmanager ");            var main = plus.android.runtimeMainActivity ();            var imm = Main.getsystemservice (Context.input_method_service);            Imm.togglesoftinput (0,inputmethodmanager.show_forced);        Document.queryselector (options[' input '). focus ();    }, 330); }}

  

Open page Default popup soft keyboard, compatible with both iOS and Android

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.