Scrolling DIV and Canvas flicker on iPhone/iPad touch

Source: Internet
Author: User

A website has been being optimized recently. We have made many changes to make it better for users on mobile devices, including replacing all Flash and Silverlight controls with HTML5, and add some events for the touch screen. In the next article, I will introduce some tips for touch screen development.

The default scroll bar of the DIV element disappears on the iPhone and iPad. In fact, this is not a problem of code or CSS. Apple hides all the scroll bars on its system by default. Of course, this also includes HTML elements. On an Apple device, the default behavior is that when a user touches and slides the screen, if the elements in the device support the scroll bar and the scroll bar is available, the scroll bar is displayed immediately and the sliding is supported. By default, the scroll bar is not displayed. Here are two articles about how to add a scroll bar to a DIV on an Apple device.

Http://www.cnblogs.com/weinan/archive/2013/01/05/2832800.html

Http://cubiq.org/scrolling-div-on-iphone-ipod-touch

Several key CSS styles:

 

In addition, if a Canvas object is dynamically generated on the page on the Apple device and can respond to the touch event, it will flash inexplicably when you click with your fingers and slide over the Canvas, to solve this problem, you only need to add the following style to the Canvas object:

 

 

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.