This time I will show you how to use JS H5 to implement WeChat shake, and what are theprecautions for using JS H5 to implement WeChat shake. The following is a practical case, let's take a look.
The project was finally launched as scheduled, but there is a new activity to be done before the Spring Festival, similar to WeChat’s shake activity. We have also been working on WeChat public accounts, but it is still a bit difficult to call the WeChat Shake interface, because it only provides Shake peripherals, nearby people and a series of red envelope pages. Compared to our needs, we only need to shake The action of shaking is completely different. In fact, the page written in H5The first stepis to shake the phone to change the color
Mainly the DeviceMotionEventThe second step, WeChat shake gesture
Compared with the first step, the shake gesture is added and the shake event is changed. Just add the method you want after the shake action, whether you want to enter the next page you create or trigger a Controller event.<%@ page contentType="text/html;charset=UTF-8" language="java" %>摇一摇
| |
您今天还可以摇次 | |
正确姿势:握紧手机,用力摇动3秒,苦练18年的麒麟臂终于派上用场了。 |
Detailed explanation of Vue key modifier event processing steps
##JS CSS3 to make image binding mouse move event amplificationThe above is the detailed content of How to use JS+H5 to implement WeChat shake. For more information, please follow other related articles on the PHP Chinese website!