•Try•
Catch

Edge-cutting Mobile CSS

Scroll Initial view past browser bar

iPhone Screenshot

One nice thing about native iPhone apps is the ability for them to have a search bar that is basically negatively positioned on the y-axis. You have to scroll up to get it to it. This effect can be simulated with this simple jQuery script.

You'll need both jQuery and modernizr.js. This script uses feature detection for touch devices via modernizr.


$(document).ready(function(){
	// after modernizr.js has ran
	$('.touch, .touch body').animate({
	  scrollTop: 0
	}, 240);
});

Comments (0)


Add a Comment





Allowed tags: <b><i><br>Comment:


** Time spent on this website is non-refundable **

modmore