以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  js 怎么监控键盘是否弹出  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=109452)

--  作者:yjf123
--  发布时间:2017/11/12 18:01:00
--  js 怎么监控键盘是否弹出

js 怎么监控键盘是否弹出,想实现:1键盘弹出执行一个事件,2.键盘隐藏后执行一个事件


--  作者:有点甜
--  发布时间:2017/11/12 19:34:00
--  

参考代码,自己写成js函数调用

 

Select Case e.Path
    Case "test.htm",""
        Dim wb As New weui
        wb.AddForm("","form1","test.htm")
        With wb.AddInputGroup("form1","ipg1","基本资料")
            .AddInput("xm","姓名","text")
            .AddInput("nl","年龄","number")
            .AddInput("rq","日期","date")
            .AddSwitch("vip","VIP客户")
        End With
        With wb.AddInputGroup("form1","ipg2","备注")
            .AddTextArea("bz",5).Placeholder = "请输入200字以内的备注"
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "button").Attribute = ""
        End With
        wb.AppendHTML("<script>var height = document.body.clientHeight;window.addEventListener(\'resize\', function () {var cheight = document.body.clientHeight; if(height == cheight) {bz.value=\'键盘收起了\'}else{bz.value=\'键盘弹起了\'};});</script>")
        e.WriteString(wb.Build) \'生成网页
End Select