Html5 touch event enables sliding up and down on a touch screen page (2)

Source: Internet
Author: User

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.

 

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: info-contact@alibabacloud.com 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.