jquery - iPhone Header Position Changed when click in HTML5-input type number -
i working jquery mobile , phonegap. facing issue on iphone version. when click in input type number, header position changes.
note: in page when focus input type number number pad opened.

----
then when touch outside of textbox number pad closed , header position automatically changed back

----
here code
$("input,select").live("blur",function() { settimeout(function(){ $("[data-role=header]").css("position","fixed"); },800); $("[data-role=footer]").show(); }); $("input,select").live("focus",function() { $("[data-role=header]").css("position","absolute"); $("[data-role=footer]").hide(); });
use code. it's worked me...
// workaround buggy header/footer fixed position when virtual keyboard on/off $('input, textarea') .on('focus', function (e) { $('header, footer').css('position', 'absolute'); }) .on('blur', function (e) { $('header, footer').css('position', 'fixed'); //force page redraw fix incorrectly positioned fixed elements settimeout( function() { window.scrollto( $.mobile.window.scrollleft(), $.mobile.window.scrolltop() ); }, 20 ); }); this bug fixed:https://github.com/jquery/jquery-mobile/issues/5532
Comments
Post a Comment