mip-iframe


mip-iframe is a way to support embedding third-party content in mip. It should be noted that the embedded content must comply with the https protocol.

If your website does not support https, you can use Baidu Cloud Acceleration or other similar services to activate https.
Baidu Cloud Acceleration activation steps: http://su.baidu.com /zhuanti/mip

QQ截图20170204112355.png

##Example

Basic use

<mip-iframe
    allowfullscreen 
    srcdoc="<p>123</p>" 
    src="http://m.baidu.com" 
    sandbox="" 
    allowfullscreen    width="400"    height="300" 
    allowtransparency="true">
</mip-iframe>

Add layout (fixed-height is an example)

<mip-iframe
    layout="fixed-height" 
    height="50" 
    allowfullscreen 
    srcdoc="<p>123</p>" 
    src="http://m.baidu.com" 
    sandbox="" 
    allowfullscreen    width="400"    height="300"
    allowtransparency="true">
</mip-iframe>

Attribute

src

Description: It has the same effect as the

src attribute of the native iframeRequired option: Yes
Type: URL
Unit: None
Value: Must use https address
Default value: None

width

Description: The ratio to height (height) is used to calculate by mip-iframe The proportion and size of the area

Required options: Yes
Type: Number
Unit: None
Default value: None

height

Description: and width (width ) is used by mip-iframe to calculate the proportion and size of the area

Required option: Yes
Type: Number
Unit: None
Default value: None

allowfullscreen

Description: The same effect as the

allowfullscreen attribute of the native iframe Required option: No
Value: empty
Default value: None

srcdoc

Description: The same effect as the

srcdoc attribute of the native iframe Required option: No
Type: HTML_code
Unit: None
Value: To be displayed in the iframe HTML content. Must be valid HTML syntax.
Default value: None

sandbox

Description: Same as the

sandbox attribute of the native iframe Required option: No
Type: string
Unit: None
Values: "", allow-same-origin,allow-top-navigation,allow-forms,allow-script
Default value: None

allowtransparency

Description: The same effect as the

allowtransparency attribute of the native iframe Required option: No
Type: String
Unit: None
Value: "", true ,false
Default value: None