Mobile Safari iOS 6.0 fixed positioning while keyb

2019-05-01 07:15发布

问题:

If you have a fixed position div set to the bottom of the screen, this div does not stay at the bottom while the virtual keyboard is shown. It would move up as the height of the page increases. This problem does not occur in iOS 5 as the div continues to stay at the bottom like it should. Any help?

回答1:

Could you simply hide the fixed div while the keyboard is active?

$("#text_field").focus(function(){
  $("#fixed_div").hide();
});


$("#text_field").blur(function(){
  $("#fixed_div").show();
});