Last active
December 20, 2015 08:09
-
-
Save Takeno/6098175 to your computer and use it in GitHub Desktop.
Hide navigation bar on iphone. It will appear only with a double tap on header
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).on('touchmove',function(e){ | |
e.preventDefault(); | |
}); | |
$('body').on('touchstart','.scrollable',function(e) { | |
if (e.currentTarget.scrollTop === 0) | |
e.currentTarget.scrollTop = 1; | |
else if (e.currentTarget.scrollHeight === e.currentTarget.scrollTop + e.currentTarget.offsetHeight) | |
e.currentTarget.scrollTop -= 1; | |
}); | |
$('body').on('touchmove','.scrollable',function(e) { | |
e.stopPropagation(); | |
}); | |
$(window).load(function () { | |
$('body').scrollTop(0,0); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment