如何处理它们在查询移动中跳出(键盘打开时)?

时间:2013-07-25 09:55:12

标签: jquery jquery-mobile

我正面临一个问题,当用户点击文本字段时我的上升了吗?我正在使用query mobile 1.3。 这是我的同样问题。 why thems go up when entering the text in text field?

jQuery Mobile Responsive Panel and Textarea 我使用这个解决方案但没有得到正确的结果。 这是我的手机1.3 js http://jsfiddle.net/fMWnz/

我应该改变哪一行以便它能够正常工作

(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 个答案:

答案 0 :(得分:1)

这是你的回答.. 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;
}