This article mainly introduces the code example of HTML5 DeviceOrientation to implement the mobile website shake function. This article directly gives the implementation code. Friends who need it can refer to it.
Before the introduction, make two statements:
The following code can be run directly, of course, don't forget to quote jQuery.
Copy the code