Detecting Phone shake using jQuery ios-shake.js

Detecting Phone shake using jQuery ios-shake.js

Detecting Phone shake using jQuery ios-shake.js:

We all are having smart phones and checking all the details/shoppings/study everything with mobile only. So all the companies are changing and concentrating more on mobile view/mobile apps than web developments. Even we are already having many mobile apps to change the songs based on the mobile shake. Today we are going to see the phone detection using used jquery ios shake js and it is expected to be implemented in all the areas soon.


Required JS Files:
1. jQuery plugin
2. jQuery ios-shake plugin


Detecting Phone Shake using jQuery Source code:
We have used jquery.ios-shake.js to observe the phone shaking. $.shake will be called if phone shaked.

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <title>Detect shake in phone using Jquery</title>
	<script type="text/javascript" src="jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="jquery.ios-shake.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
                callback: function() {
				alert("Follow us on");
<div id="content">
<h1>Detecting Phone shake using jQuery</h1>
<div id="welcome">Shake your phone to get the alert</div>



Phone shake detection output1


After shaking the phone:

Phone shake detection output2



jQuery Recommended Books:

1,157 total views, 2 views today

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.