ThinkPHP3.2.3 achieve random recommendation of articles by shaking mobile phones

Source: Internet
Author: User
Provides various official and user-released code examples. For code reference, you are welcome to learn how to shake your mobile phone. Based on html5, you can sense DeviceOrientation, it provides advanced encapsulation of the underlying direction and motion sensors to easily implement interesting functions such as gravity sensing and compass. Today, we will show THINKPHP3.2.3 in an example to show how THINKPHP3.2.3 achieves the random recommendation of articles by shaking the mobile phone.
You can visit the home page of on your mobile phone or shake it with your mobile phone. Then you can see the random recommendation result on the right side.

First, introduce jquery. js into the template page to be shaken and the shade. js that detects mobile phone shake. The HTML structure is as follows:
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.