"Go" lets the IFRAME support scrolling on the iOS device's mobile browser

Source: Internet
Author: User

HTML codeWhen using an IFRAME or other HTML element, you need to wrap them with an element such as a div:
<class= "Scroll-wrapper">       <src ="" ></ iframe >   </ Div >
This div will be used as the underlying container to support internal scrolling.CSS CodeFor an IFRAME to support scrolling, you need a common CSS property and a CSS property that few people know about:
. scroll-wrapper {       -webkit-overflow-scrolling:touch;       OVERFLOW-Y: scroll;       /* Tip: Please add the size (dimensions) or location (positioning) information you want to set here! */   }   . scroll-wrapper iframe {/       * your own specified style */   

-webkit-overflow-scrolling:touch; The property value is designed for elements that need to be scrolled when the browser overflows (overflow). If you do not specify this property, when you want to scroll the IFRAME, it will actually cause the outer page to scroll, through which you can control the IFRAME scrolling! In the original author's blog site, the following CSS was used:

. demo-iframe-holder {     position:fixed;      right:0;      bottom:0;      left:0;     top:0;     -webkit-overflow-scrolling:touch;     OVERFLOW-Y: scroll;   }      . Demo-iframe-holder iframe {     height:100%;     width:100%;   }   

Transferred from: http://www.oicqzone.com/pc/2015040321369.html

"Go" lets the IFRAME support scrolling on the iOS device's mobile browser

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.