Get the App
SLTechnology News&Howtos  ›  Development  › 

Layui opens the iframe window of layer how to close

Shulou Source: shulou.com Published: 2022-06-03 10:58:45 10月03日 Update

This article mainly introduces how to close the iframe window of layer opened by layui. It is very detailed and has certain reference value. Friends who are interested must finish reading it.

(1) close a specific iframe

/ / when the iframe page closes itself, execute the following js script var index = parent.layer.getFrameIndex (window.name) on the iframe page; / / get the index parent.layer.close (index) of the current iframe layer first; / / close again

(2) the parent page passes parameters to the iframe pop-up layer

Var collectionId = parent.$ ("# hideCollectionId"). Val (); / / Hidden fields can be defined in the parent page. Id is hideCollectionId, and jquery is required.

(3) close all pop-up layers

If there is no complex logic such as layer overlay, all pop-up layers can be turned off as needed.

Layer.closeAll (); / / Crazy mode, close all layers layer.closeAll ('dialog'); / / close information box layer.closeAll (' page'); / / close all page layer layer.closeAll ('iframe'); / / close all iframe layer layer.closeAll (' loading'); / / close load layer layer.closeAll ('tips') / / close all tips layers above is "layui opens the iframe window of layer how to close" all the contents of this article, thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Pages content articles complexity madness value information interests available in guys buddies more patterns knowledge indexes scripts industries information information channels logic Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL macOS Shulou Information Shulou Technology Redmi