Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sammich

macrumors 601
Original poster
Sep 26, 2006
4,306
268
Sarcasmville.
Never mind. I'm going to switch to Google's fixed pane scrolling

Thanks for dropping by :)

What I'm making in the link below is a little 'web app' as a hobby to learn a bit about web development (not truly, this is specifically targeted at the iPad). It's supposed be an order system for a cafe I work at.

The source is here. To view the page, open this on your iPad (it's written for the iPad, so please view the page on the iPad, landscape preferably).

The issue I'm having is with the pane with the numbers going down. It's drag to scroll and I've made an 'elastic' scroll if you drag beyond the top items, it'll snap back. Now the problem is that once you let go, it has a short delay before it begins to snap back.

Any ideas on how to remedy this would be greatly appreciated.

Thanks.

The problem code is below. About halfway down the JS script in jsfiddle.

Code:
document.getElementById('itemslistpanel').addEventListener('touchend', function(event) {
		$touchenditemlisty = event.changedTouches[0].pageY;
		$itemlistdelta += $touchenditemlisty-$touchstartitemlisty;
		if ($itemlistpos > 0) {
			document.getElementById('itemslistpanel').style.webkitTransform = 'translateY(0px)';
			$('#itemslistpanel').css('-webkit-transition-duration', '.35s');
			$itemlistdelta = 0;
		}
	}, false);
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.