have been free to develop Web sites on the PC, of course, I also made the site into a responsive.
But have not studied mobile gestures, the last interview in Ctrip a topic is now deeply engraved in my mind:
What to do with the swipe event on your phone, like a common app swipe to the right to appear on the menu?
Today, Hammer.js studied, she mainly handles mobile gesture events, just as her ad:add touch gestures to your page.
My train of thought:
1. When the finger slides to the right, the left block moves right
2. Left is hidden when the finger is sliding in the red
The code is as follows:
<! DOCTYPE html>
Example effect: http://2.liteng.sinaapp.com/javascript/hammer.html
The main idea is to walk in two steps:
1. Create an instance var mc = new Hammer (myelement);
2. Bind the example binding event Mc.on ("Panleft/panright/tap/press", FTN);
Study Official website: http://hammerjs.github.io/
Original address: Http://liteng.org/node/40
Cannot forget gesture events on the mobile side