如何让您的页面在虚拟键盘覆盖时将输入元素滚动到视图中?
How to get your page to scroll an input element into view when the virtual keyboard covers it?
当我在 iOS Safari 和 Chrome 中加载我的网站时,这是自动完成的,但当我在 cordova 中加载它时,没有完成。如果可能的话,我更喜欢非 JS 解决方案。
使用:https://github.com/driftyco/ionic-plugins-keyboard
与:
window.addEventListener 'native.keyboardshow', (e) ->
cur_height = $('body').height()
$('body').height cur_height - e.keyboardHeight
window.addEventListener 'native.keyboardhide', (e) ->
$('body').height '100%'
当我在 iOS Safari 和 Chrome 中加载我的网站时,这是自动完成的,但当我在 cordova 中加载它时,没有完成。如果可能的话,我更喜欢非 JS 解决方案。
使用:https://github.com/driftyco/ionic-plugins-keyboard
与:
window.addEventListener 'native.keyboardshow', (e) ->
cur_height = $('body').height()
$('body').height cur_height - e.keyboardHeight
window.addEventListener 'native.keyboardhide', (e) ->
$('body').height '100%'