zoukankan      html  css  js  c++  java
  • html动态编辑框

    简述:

    随着在输入框中增加字符,动态矿高度增加(IE9及以上 chrome  firefox)

    由于IE8 不支持oninput函数,所以不能实现此效果

    事件函数:

    function feedDivOnInput(obj){
        obj.style.height=30+'px';
        obj.style.height=obj.scrollHeight+'px';
    }
    
    function feedTextAreaOnInput(obj){
        obj.style.height=30+'px';
        obj.style.height=obj.scrollHeight+'px';
    }

    html标签

                <div class="discusstexarea_div c_9 mb" oninput="javascript:feedDivOnInput(this)">
                    <textarea name="postMsg" class="discusstextarea  c_9" oninput="javascript:feedTextAreaOnInput(this)">我的评论...</textarea>
                </div>

    效果:

    单行,


    多行,

  • 相关阅读:
    网络面试题2
    网络
    Linux os
    操作系统面试题2
    操作系统面试题
    Linux
    算法-字符全排列
    第k大数问题
    地址
    ListView里面嵌套CheckBox
  • 原文地址:https://www.cnblogs.com/zhujiabin/p/4527031.html
Copyright © 2011-2022 走看看