built a new version with ontouchevent rather than click events.