This commit is contained in:
xuhe@fangjia.com
2018-03-30 15:04:38 +08:00
parent be7ca18a25
commit 36ba2e9aca
2 changed files with 34 additions and 25 deletions
+16 -12
View File
@@ -81,7 +81,7 @@
<div class="searchbar row commentReleaseBox dn">
<div class="search-input col-85">
<input type="text" maxlength="250">
<input type="text" maxlength="250" id="commentInput">
</div>
<a class="col-15" id="publishBtn">发布</a>
</div>
@@ -538,17 +538,21 @@ function addComment(){
console.log(error);
});
}
mui.init({
beforeback: function() {
     //获得父页面的webview
var list = plus.webview.getWebviewById('yfindex.html');
     //触发父页面的自定义事件(refresh),从而进行刷新
mui.fire(list, 'refresh');
//返回true,继续页面关闭逻辑
return true;
}
});
$(function() {
$('#commentInput').on('click', function () {
var target = this;
// 使用定时器是为了让输入框上滑时更加自然
/*setTimeout(function(){
target.scrollIntoView(true);
},100);*/
setTimeout(function(){
document.body.scrollTop = document.body.scrollHeight;
target.scrollIntoView(true);
},100);
});
})
</script>
</body>
</html>