how to join two table in codeigniter easily[updated] | ci_model | ci_controller | codeigniter 3 -datainflow
Shake event
Today, In this post I am going to explain you how to change text using shake event using jquery.You know jquery is most powerful library.We do many with jquery.If has different kind of event method.Shake event is one of the event for mobile device.
You need mobile device for this event.Here I am shaking the phone and text is changing.
Javascript code
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script type="text/javascript" src="js/jquery.ios-shake.js"></script> <script type="text/javascript" src="js/jquery.ui.shake.js"></script> <script type="text/javascript" > var i=0; $(document).ready(function(){ $.shake({ callback: function() { mobileShake(); } }); }); function mobileShake(){ i++; $('#shake').html("shake"+i); } </script>
HTML code
<html> <head> <title>Shake phone- DataInFlow</title> <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"> </head> <body> <h1 id="shake">Shake the phone</h1> </body> <html>
Related posts