I was wondering of there is a way to trigger the shake event within a mobile web app?
--EDIT--- Without using Phonegap.
I was wondering of there is a way to trigger the shake event within a mobile web app?
--EDIT--- Without using Phonegap.
You didn't google much did you? :)
Phonegap - Handling Shake Events
edit: Read this Stackoverflow Article. Dont get distracted by the "Phonegap" in the title - it works without it. As a summary: You can invoke Java Code with Javascript and would invoke the native Accelerometer from your web code. Invoking Java Code with Javascript
Shake.js is a custom 'shake' event JavaScript plugin for mobile web browsers using device accelerometer. Your web browser must support the devicemotion event for this plugin to work. Shake.js uses built-in feature detection to determine if it can run in your web browser. It will terminate silently on non-supporting browsers.
You might want to check this out: http://functionn.blogspot.com/2012/03/shakejs-custom-shake-event-javascript.html