<div class="mui-content">
<div class="mui-scroll-wrapper">
<div class="mui-scroll">
<div class="mui-content-padded">
<form id="fm_material_affirm" class="mui-input-group">
<div class="mui-table">
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
<input type="text" placeholder="1" class="mui-register"/>
</div>
</div>
</div>
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
<input type="text" placeholder="2" class="mui-stylist"/>
</div>
</div>
</div>
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
<input type="text" placeholder="3" class="mui-stylist"/>
</div>
</div>
</div>
<div class="mui-row">
<div class="mui-table-cell mui-col-sm-12 mui-col-xs-12">
<div class="mui-input-row">
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
js :
mui.init();
var deceleration = mui.os.ios?0.003:0.0009;
mui('.mui-scroll-wrapper').scroll({
bounce: false,
indicators: true, //是否显示滚动条,
deceleration:deceleration
});
document.addEventListener("focusin",function(e){
var target = e.target;
if (target.tagName && (target.tagName === 'TEXTAREA' || (target.tagName === 'INPUT' && (target.type === 'text' || target.type === 'search' || target.type === 'number'))))
{
setTimeout(function(){
target.scrollIntoView(true);
},200);
}
});
问题:
target.scrollIntoView(false);使用这个后,输入框聚焦后都能在可视区显示,有一个问题就是:输入框可视后,聚焦的输入框所在的<div class="mui-scroll-wrapper">滚动条不能下拉查看,聚焦输入框上面不可视的数据,是怎么回事呢,各位大侠!具体代码查看附件