wtfk.html 2.1 KB
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>问题反馈</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/wtfk.css">
    <script src="js/base.js"></script>
    <script src="js/jquery.min.js"></script>
</head>
<body>
<div class="container">
    <div class="home_container">

        <div class="input_container">
            <input type="text"  placeholder="标题" >
            <input type="text"  placeholder="姓名">
            <input type="text"  placeholder="联系方式">

            <textarea placeholder="详情描述"></textarea>
        </div>
        <!--点击下载按钮-->
        <div class="btn_box">
            <div class="btn_box_a" onclick="btn_sub()">
                <a href="#">提交</a>
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    function btn_sub() {
        window.location.href="index.html";
    }
    $("input").blur(function(){
        setTimeout(function() {
            var scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
            window.scrollTo(0, Math.max(scrollHeight - 1, 0));
        }, 300);
    })
    //聚焦监听
    $('input').focus(function() {
        if((/Android/gi).test(navigator.userAgent)) {
            window.addEventListener('resize', function() {
                if(document.activeElement.tagName == 'INPUT' ||
                    document.activeElement.tagName == 'TEXTAREA') {
                    window.setTimeout(function() {
                        document.activeElement.scrollIntoViewIfNeeded();
                    }, 0);
                }
            });
        }
    })

    $("textarea").blur(function(){
        setTimeout(function() {
            var scrollHeight = document.documentElement.scrollTop || document.body.scrollTop || 0;
            window.scrollTo(0, Math.max(scrollHeight - 1, 0));
        }, 300);
    })

</script>
</body>
</html>