IFrame

Updated at:

Introduction

The IFrame component embeds another document, such as a webpage, into the current page. This lets you display content from other sources, such as videos, maps, or external websites.

Configuration items

Category

Configuration

Example

Description

Content

Pattern

Configure the IFrame mode

URL

Sets the address of the document to embed in the IFrame.

Code

Sets the HTML code snippet to embed in the IFrame.

Interaction

Hide

Hides the component. For more information, see Common properties.

Keep layout when hidden

Keeps the layout space when the component is hidden. For more information, see Common properties.

Style

Height

Sets the component height. For more information, see Common properties.

Margin

Sets the component margin. For more information, see Common properties.

Toolbar

Shows or hides the toolbar.

Toolbar text

Sets the text for the toolbar. This option is available only when the toolbar is displayed.

CSS Style

Background color

Sets the background color of the IFrame component. For more information, see Common properties.

Border

Sets the border color of the component. This corresponds to the CSS `border-color` property. For more information, see the MDN documentation.

Border radius

For more information, see Common properties.

Toolbar background color

Sets the background color of the toolbar. For more information, see Common properties.

Toolbar text color

Sets the text color of the toolbar. This corresponds to the CSS `color` property. For more information, see the MDN documentation.

Properties and methods

Name

Type

Example

Description

src

string

iframe.src

IFrame Document URL

code

string

iframe.code

The HTML code snippet embedded in the IFrame.

topBarText

string

iframe.topBarText

The title text of the toolbar.

setSrc

func

iframe.setSrc('https://www.aliyun.com/')

Sets the URL of the document in the IFrame.

clearSrc

func

iframe.clearSrc('')

Clears the IFrame document URL.

setCode

func

iframe.setCode('

<iframe src="https://www.aliyun.com/" title="W3School Online Tutorials"></iframe>')

Sets the HTML code snippet to embed in the IFrame.

clearCode

func

iframe.clearCode('')

Clears the HTML code snippet embedded in the IFrame.

setTopBarText

func

iframe.setTopBarText('Alibaba Cloud')

Sets the title text of the toolbar.

clearTopBarText

func

iframe.clearTopBarText('')

Clears the title text of the toolbar.

click

func

iframe.click()

Click Actions.