How to handle them jump out(while keyboard open) in query mobile?

混江龙づ霸主 提交于 2019-12-25 07:33:53

问题


I am facing one problem actually my them goes up when user click on text field ?I am using query mobile 1.3. THIS IS MY SAME PROBLEM . why thems go up when entering the text in text field?

Solution jQuery Mobile Responsive Panel and Textarea I use this solution but not get proper result. Here is my mobile 1.3 js http://jsfiddle.net/fMWnz/

In which line i should change so that it will work

(function(root, doc, factory) {
    if (typeof define === "function" && define.amd) {
        // AMD. Register as an anonymous module.
        define(["jquery"], function($) {
            factory($, root, doc);
            return $.mobile;
        });
    } else {
        // Browser globals
        factory(root.jQuery, root, doc);
    }
}(this, document, function(jQuery, window, document, undefined) {
    (function($) {
        $.mobile = {};
    }(jQuery));
    (function($, window, undefined) {
        var nsNormalizeDict = {};

回答1:


Here is your answer.. window.resize due to virtual keyboard causes issues with jquery mobile

1) Go into jquery.mobile-1.x.x.js

2) Find $.mobile = $.extend() and add the following attributes:

last_width: null,
last_height: null,
3) Modify getScreenHeight to work as follows:

getScreenHeight: function() {
    // Native innerHeight returns more accurate value for this across platforms,
    // jQuery version is here as a normalized fallback for platforms like Symbian

    if (this.last_width == null || this.last_height == null || this.last_width != $( window ).width())
    {
        this.last_height = window.innerHeight || $( window ).height();
        this.last_width = $(window).width();
    }
    return this.last_height;
}


来源:https://stackoverflow.com/questions/17854719/how-to-handle-them-jump-outwhile-keyboard-open-in-query-mobile

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!