Dec 11, 2011

Some may say that web apps aren't capable of providing the level of user experience native apps do, functionality and distribution channels aside, I don't believe so.

I believe web apps can be as good as native apps, especially on iOS.

From the top of my head, Twitter and Asana mobile web apps are two interesting examples of what can be achieved, but there's still room for improvement.

There are many factors that may prevent your web app from being as good as a native one, I'll write a post on that and share my findings. But today:

Improving Mobile Web App Responsiveness

By leveraging Touch instead of the default Click events.

The problem with Click events on mobile browsers is that they come with a 300ms lag, which is OK for websites, but not for controls or app navigation.

Fixing it is as simple as replacing " onclick " with " ontouchstart ", and I've done so on a random library I came accross today: SwipeJS - swipejs.com

**Examples ** (view these on your mobile)

onClick: swipejs.com

onTouchStart: lmjabreu.github.com/Swipe

Notice the responsiveness difference when switching slides it selecting tabs on the touchstart example.

Source if available over at github.com/lmjabreu/Swipe, slapped a chunk of code on both branches to support ontouchstart when available, demo purposes only.

More articles