I am creating a mobile web app with jQuery Mobile and would like to hide the search bar above the visible area. So the user would need to pull the page down to see the search ba
jQuery Mobile has a special scroll function $.mobile.silentScroll(). It scrolls without animation but at the same time it doesn't trigger scroll
event.
You also need to wait until page is fully loaded into DOM before calling this function. You can bind it to pagebeforeshow
or pageshow
.
$(document).on("pagebeforeshow", "#page", function () {
setTimeout(function () {
$.mobile.silentScroll(100);
}, 10);
});
Demo