|
softInputMgr模块(弹出软键盘) demo演示
[复制链接]
本帖最后由 伤飞工作室 于 2018-1-25 17:26 编辑
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
- <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
- <title>title</title>
- <link rel="stylesheet" type="text/css" href="../css/api.css" />
- </head>
- <body>
- <input type="text" placeholder="请输入搜索内容" id="search-input">
- <a class="button" tapmode="active" onclick="opend()">弹出</a>
- </body>
- <script type="text/javascript" src="../script/api.js"></script>
- <script type="text/javascript">
- apiready = function() {
-
- };
- //该方法使用于打开win 自动触发软键盘(功能类似于淘宝的搜索框,点击搜索后自动定位光标、并弹出软键盘。)
- //setimeout中的时间(400)将由打开win动画的时间定为,必须比打开动画时间大于100,如果默认不使用动画那就要写100
- function opens(){
- setTimeout(function() {
- var softInput = api.require('softInputMgr');
- softInput.toggleKeyboard();
- document.getElementById("search-input").focus()
- },400);
- }
- //该方法使用于已打开状态下的页面 手动触发软键盘
- function opend(){
- var softInput = api.require('softInputMgr');
- softInput.toggleKeyboard();
- document.getElementById("search-input").focus()
- }
- </script>
- </html>
复制代码
只放一个正在做的播放器,这里就不上传demo压缩包了 新手自己动手实验才是自己的
|
本帖子中包含更多资源,您需要 登录 才可以下载或查看,没有帐号?立即注册
X
|