If we have only one header line, we can only follow the code for the main header.
$(document).on('focus', 'select, input, textarea', function () { $('#main-headerbar').css({'position': 'absolute', 'top': '0px' }); }); $(document).on('blur', 'select, input, textarea', function () { $('#main-headerbar').css({ 'position': 'fixed' }); });
If we have two heading lines, and the second heading will be displayed under the main heading line (if the height of the main heading bar is 47 pixels, then set the top style for the second heading, top: 47px).
$(document).on('focus', 'select, input, textarea', function () { $('#main-headerbar').css({'position': 'absolute', 'top': '0px' }); $('#Second-headerbar').css({ 'position': 'absolute', 'top' : '0px' }); }); $(document).on('blur', 'select, input, textarea', function () { $('#main-headerbar').css({ 'position': 'fixed' }); $('#Second-headerbar').css({ 'position': 'fixed', 'top': '47px' }); });
OR follow iOS fix for fixed entry position elements
source share