美文网首页
webapp开发总结

webapp开发总结

作者: 周萌萌 | 来源:发表于2017-03-15 19:01 被阅读101次

//文本域输入自适应高度
var textarea = document.getElementById('reserve-input');
function makeExpandingArea(el) {
var setStyle = function(el) {
el.style.height = 'auto';
el.style.height = el.scrollHeight + 'px';
}
var delayedResize = function(el) {
window.setTimeout(function() {
setStyle(el)
},
0);
}
if (el.addEventListener) {
el.addEventListener('input', function() {
setStyle(el)
}, false);
setStyle(el)
} else if (el.attachEvent) {
el.attachEvent('onpropertychange', function() {
setStyle(el)
});
setStyle(el)
}
if (window.VBArray && window.addEventListener) { //IE9
el.attachEvent("onkeydown", function() {
var key = window.event.keyCode;
if (key == 8 || key == 46) delayedResize(el);

        });
        el.attachEvent("oncut", function() {
            delayedResize(el);
        }); //处理粘贴
    }
}
makeExpandingArea(textarea);//方法调用

//解决iOS端input触发焦点的时候,键盘会有遮住输入框的情况
$(document).on('click', '#reserve-input', function() {
var target = this;
setTimeout(function() {
target.scrollIntoView(true)
}, 100)
})
//点击任何区域隐藏元素,其中的e是event事件对象
e.target.tagName.toLowerCase()

相关文章

  • webapp开发总结

    //文本域输入自适应高度var textarea = document.getElementById('reser...

  • 微信WebApp开发总结笔记

    后台: c# and 网络 部分: MVC Ctrl=>Model=>View ViewBag/ViewData/...

  • ionic & cordova基础环境配置

    近期刚接触到移动端webApp的开发,入门需要配置ionic&cordova的基础环境。翻阅众多的技术帖之后总结出...

  • Cordova开发跨平台WebApp

    对于WebApp我是拒绝的,但存在即价值,学习总结吧.(关键是boss让用,老项目也是这么开发的?) Cordov...

  • iOS-webApp开发Js交互

    国内越来越多的移动端开发趋向于webApp的形式去开发了,那在webApp开发中经常要做一些Js交互的操作。官方的...

  • 9/22 课堂笔记

    jQuery mobileAjax异步请求webAPP混合开发节约开发时间提高开发效率react native(封...

  • webapp开发技巧

    web app开发技巧

  • webApp项目开发

    1. 开发项目准备 将项目基本架构搭建好使用npm init -f 生成package.json 设置视口 (me...

  • webApp的开发

    入门 cordova入门——cordova环境配置(一) Cordova环境安装设置

  • WebApp开发概要

    内容比较零散,大部分可以直接拉入文件中使用,使用时请注意检查是否正确,如果错误希望留言以便修改。在开发移动站点的时...

网友评论

      本文标题:webapp开发总结

      本文链接:https://www.haomeiwen.com/subject/wxhmvttx.html