Solve the problem of ifram not sliding in iOS and pad

Source: Internet
Author: User


Today encountered a problem, in the mobile phone embedded ifram, in the iOS and pad will only display the first screen content, the following content is loaded but all below, cannot slide display,
So I took a look at it. (Tested available)


Add the following CSS style to the parent container of the IFRAME:

-webkit-overflow-scrolling:touch;overflow:auto;

For Android less than 4.0 version of the browser does not support overflow problem, you can use the following JS resolution (not valid for UC):

    functionTouchscroll (ID) {varEl =document.getelementbyidx_x (ID); varScrollstartpos = 0; document.getelementbyidx_x (ID). AddEventListener ("Touchstart",function(event) {Scrollstartpos= This. scrolltop + event.touches[0].pagey;                Event.preventdefault (); }, false); document.getelementbyidx_x (ID). AddEventListener ("Touchmove",function(event) { This. scrolltop = Scrollstartpos-event.touches[0].pagey;                Event.preventdefault (); }, false); }

Solve the problem of ifram not sliding in iOS and pad

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.