views:

589

answers:

1

Hello guys,

is it possible to listen for an iPhone (or any mobilephone with accelerometer) shake event with javascript? You know like shakin the iphone to shuffle the next song in itunes i want to call a js fuction on my website when the iphone got shaken.

thank you for your tips and help

+2  A: 

Not as a straight web app, no. If you wrap your web app in PhoneGap, it exposes accelerometer and other app-only features to the site running within it, but the downside is that people have to actually download your app - they can't just browse to a site in Safari.

ceejayoz