Disable Browser Bounce In IOS Browser
When your browser in the iPad or iPhone browser you will notice when you reach the top or bottom of the page you get what i call the browser bounce. This is when the page finishes but the browser carry’s on and bounces back down. In a recent iPad web App i have been developing i found it pretty annoying, i want the web App to feel like a web App and not like your in the browser. With this little code snippet you can disable it.
paste in <head> tag or common javascript file for WebApps
<script type="text/javascript">
$(document).bind(
'touchmove',
function(e) {
e.preventDefault();
}
);
</script>
Thanks for Ref:
http://www.photoshop-plus.co.uk/2012/06/26/ios-browser-bounce-how-to-disable-it/
POSTED ANS :2
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="viewport" content="width=device-width, user-scalable=no" />
7
This will prevent scrolling on the whole page
document.ontouchmove = function(e) {e.preventDefault()};
In your case, where you want some divs to be scrollable, and some not to, you should be able to catch the event before it gets to the document
scrollableDiv.ontouchmove = function(e) {e.stopPropagation()};
No comments:
Post a Comment