Home >Web Front-end >Layui Tutorial >How to close the current pop-up window in layui

How to close the current pop-up window in layui

王林
王林Original
2020-11-23 15:03:1510502browse

Layui method to close the current pop-up window: first get the name of the current window; then use [parent.layer.close(index);] to close the current window.

How to close the current pop-up window in layui

The operating environment of this tutorial: Windows 10 system, layui version 2.5.6. This method is suitable for all brands of computers.

layui method to close the current pop-up window:

(Learning video sharing: javascript video tutorial)

Ideas:

1. Get the name of the current window;

2. Close the window.

Implementation code:

var index=parent.layer.getFrameIndex(window.name); //获取当前窗口的name
               parent.layer.close(index);//关闭窗口

Related recommendations: layui

The above is the detailed content of How to close the current pop-up window in layui. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn