javascript - Want Focus, but don't want scrolling iPhone web-app -


i building ios web app. want disable scrolling, used:

$(document).bind('touchmove', function(e) {     e.preventdefault(); }); 

and works perfectly. however, if user taps on input, not focused. "no big deal", thought. half fixes problem:

$("div#searchbarview input").hammer().on("tap", function(){ //i'm using hammer.js touch library.     this.focus(); }); 

so keyboard comes up, no cursor or blue focus-haze appear. if type, no text appears. ideas how focus, keep scrolling off?

thanks!

-sean

rather using javascript prevent scrolling, might want @ alternative method, should able prevent scrolling pure css

html, body {   overflow: hidden;   height: 100%;   padding: 0;   margin: 0; } 

then can disable bounce - how prevent app running in phone-gap scrolling vertically?


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -