Develop your own one page scroll plug-in (2)

Source: Internet
Author: User

Develop your own one page scroll plug-in (1)

5. Features in other browsers

I often keep releasing the current version to get continuous feedback on GitHub. My development model is continuous iteration. At the beginning, I didn't pay too much attention to the effect of the mobile phone. In fact, I haven't paid much attention to this problem yet. But I actually used a simple solution. The init_scroll method can also be executed on the mobile phone by detecting and converting data. But this will not always achieve the effect, such as in the android browser. So I finally implemented a fallback to let the plug-in roll back to the local scrolling feature:

......

......

First, I define a variable to activate this fallback. The fallback content is the operation after the plug-in triggers fallback.

The code snippet above detects the browser width. If the width reaches a certain range, fallback is triggered, and then this method removes all display methods, turn the page into a normal sliding interface. This plug-in uses disabled-onepage-scroll to determine whether initialization has been performed. If not, it will be re-initialized.

This solution is not the best, but it can provide you with a solution. After all, it is not easy to solve one page scroll on your mobile phone.

6. cross-browser testing

Testing is a necessary part of the development process. When you release a plug-in, you must ensure that it can be successfully executed on most hosts. Chrome is my main browser and I often use it for development. If there is a browser you are familiar with, it will bring many benefits to your development, however, the disadvantage is that your perspective is limited and you cannot find many problems. For me, I will also test it in other browsers, including Firefox, Safari, and opera.

I mainly use my MacBook Air for development, but I also have computers with other operating systems in my home. I need to simulate all the environments of various users as much as possible. As we all know, ie is a big problem.

In addition, you should know that there are different browsers on mobile phones.

......

......

Read the full text: Develop your own one page scroll plug-in (2)

Develop your own one page scroll plug-in (2)

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.