在phonegap应用程序中停止Android键盘弹出窗口中的页脚移动

时间:2018-05-30 08:07:08

标签: javascript jquery footer hybrid-mobile-app phonegap

我正在使用混合应用程序,每当我点击任何DOM输入时,键盘就会出现,并且我的页脚也会在其顶部。但我需要将页脚始终放在底部。最好的方法是什么?我也使用下面的jquery,但它没有完美的工作。同样在这个jquery中,我需要跳过一些其名称不等于 item 的输入框。如何添加此例外?还有其他很好的方法可以完成这项任务吗?

if ('ontouchstart' in window) {     

                        /* bind events */

                        $(document)  
                        .on('focus', 'input[type=text]")', function() { 
                            $('.footer').css('position', 'absolute');
                            $('.footer').css('bottom', ''); 
                        })

                        .on('blur', 'input[type=text]', function() { 
                            $('.footer').css('position', 'fixed');  
                            $('.footer').css('bottom', '0');
                        });



                    }

0 个答案:

没有答案
相关问题