function scrollToEnd(){
document.body.scrollTop = document.body.scrollHeight;
}
var interval;
function scrollToEnd(){
console.log(document.body.scrollTop,document.body.scrollHeight)
document.body.scrollTop = document.body.scrollHeight;
}
var interval;
if (isAndroid) {
//這個是安卓操作系統
$('.showkeyboad').focus(function(){
var target = this;
setTimeout(function(){
target.scrollIntoViewIfNeeded();
},400);
clearInterval(interval);
})
$('.showkeyboad').blur(function() {
interval = setInterval(function() {
scrollToEnd();
}, 500);
});
}else{
$("input,textarea").on("blur",function(){
setTimeout(function(){
window.scrollTo(0,0);
},100)
}).on('focus',function(){
var clientHeight = document.documentElement.clientHeight ||document.body.clientHeight;
var offsetTop = $(this).offset().top - (clientHeight / 4);
setTimeout(function(){
window.scrollTo(0,offsetTop);
},100)
})
},
destroyed(){//銷毀
clearInterval(interval)
},
進行混合式開發時經常會出現系統不兼容導致的輸入框問題,記錄一下

