• 触屏版类似刷新页面文本框获取焦点的同时弹出手机键盘的做法


    手机触屏版想要自动弹出键盘要满足的三个条件:

    1、文本框获取焦点

    2、手触屏该页面的屏幕

    3、无延迟

    实现实例(类似微信微博):

    <!DOCTYPE html>
    <html lang="zh-cn">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <style>
        .page{
            100%;
            height:400px;
            background:#333;
            overflow:hidden;
        }
        .page a{
            display: block;
            50px;
            height:50px;
            margin:100px auto;
        }
        .com {
            display: none;
            100%;
            height:500px;
            overflow:hidden;
        }
        .com textarea{
            display: block;
            90%;
            height:200px;
            margin:50px auto;
        }
    </style>
    <body>
         <div class="page">
             <a href="javascript:void(0);">评论</a>
         </div>


         <div class="com">
             <textarea></textarea>
         </div>
    </body>
    <script>
          $('.page a').on('click',function(){
              $('.page').hide()
              $('.com').show()
              $('.com textarea').focus()
          })
          
    </script>

    </html>

  • 相关阅读:
    Linux监控和安全运维 2.0 zabbix配置邮件告警
    Linux监控和安全运维 1.9 zabbix增加客户端监控
    linux系统构架
    给虚拟机添加eth1网络适配器(网卡)
    linux系统构架
    linux系统构架
    Linux系统构架
    VIM-Sed常用的一些记录。。。逐渐学习。。
    AIX用chsec命令修改快捷修改配置文件
    SYSLOG审记日志的配置。
  • 原文地址:https://www.cnblogs.com/dearxinli/p/4493605.html
Copyright © 2020-2023  润新知