I didn't go anywhere during the May Day holiday. I slept for three days. Today I am dizzy and put into my work, but I have made some results.
Last week, we used the html5 touch event to make a simple slide, achieving the effect of continuous page sliding up and down. refer to the previous
Article and codeHtml5 touch event for sliding up and down a touch screen page (1)
Today, we have achieved the following results:When the page slides to the top and bottom of the page, it cannot continue to slide.;
Because a touch event is added to the page, the original default properties of the scroll bar and other pages will not be changed. The demo in the previous article can always slide up or down, but the reality is that this is not desirable.
Complete code:
1 <! Doctype html> 2
The above is the complete demo code. The jquery used this time is a little elastic because animate can be used to slide to the top and bottom.
The following is the demo effect. You can also use the mobile phone to copy the Code. The Code is simple, but the effect has not been taken into account for compatibility and robustness.