+ 3
Is there any API for shaking in js??
11 Answers
+ 6
Instead of deleting the original thread you created for this same question, you could have just edited the title/description. The resources that I took the time to seek out for you contained exactly what you're asking for, so it's kind of annoying that you deleted the thread and asked the same question when resources were already given to you for this.
Anyways, best of luck to you! Google is an amazing tool.
+ 6
Fair enough. Lets get the misunderstanding taken care of first then and I'll poke around further for you.
When you say shaking, are you trying to detect when a user shakes their phone? Are you trying to make their screen have a "shake" effect? etc..
If you wouldn't mind further explaining exactly what you're trying to accomplish, I'll be more than happy to do what I can further on my end for you.
+ 6
You want an event to be triggered when a person shakes his phone sideways?
you'll have to know about .
window.addEventListener("'devicemotion");
https://code.sololearn.com/Wh2kR2rMg69I/?ref=app
+ 5
When you look at those API links, it may help to see what the sensor output looks like (just for the visualization, since the code isn't the shake API you're seeking). The red line is the raw data (the other two colors average the last 10 and 100 readings):
https://code.sololearn.com/WanUHKGqxs5r/?ref=app
+ 4
http://qnimate.com/detect-shake-using-javascript/
https://github.com/alexgibson/shake.js
https://developers.google.com/web/fundamentals/native-hardware/device-orientation/
http://www.bestjquery.com/2015/01/detect-shake-phone-using-jquery/
http://www.profoundlogic.com/docs/display/PUI/Accelerometer+Test+for+Shaking
http://www.gianpa.com/shake/
http://www.gianpa.com/html5-accelerometer-shake/
https://coderwall.com/p/vqorew/shake-js
https://gist.github.com/minwe/9887001
+ 4
It is only for vibration. If the vibration means your shake shake thing.šš
https://www.sololearn.com/learn/888/?ref=app
+ 2
I am so sorry for that but that links was not for shaking
+ 2
I mean when a person shake's his/her phone
+ 2
can use ondevicemotion , or ondeviceorientation to help detect that shake .
https://code.sololearn.com/WA62p23avXtm/?ref=app
https://code.sololearn.com/WDB8e5nNlZe9/?ref=app
+ 1
Thanks all
- 1
Can you make a simple example plz