cuốn sách gpt4 ai đã làm

Hiển thị lớp phủ trên tab cha (trang) cho đến khi tất cả các tab con (trang) của nó được mở

In lại Tác giả: Walker 123 更新时间:2023-11-28 06:50:36 25 4
mua khóa gpt4 Nike

假设我有父页面。

Click

当我单击“打印”时,会打开一个新选项卡(页面)以进行打印预览。

我想要的是,当我单击“打印”时,父选项卡(页面)上应显示覆盖层,以停止进一步的工作,直到子选项卡关闭。

Because when print tab (page) (child) is opened, most of the functions on parent tab (page) are not working properly.

注意:我正在使用 Google 默认打印/预览功能。

我无法编写代码来执行上述场景。如何在父页面中检测到其子页面已关闭?

câu trả lời hay nhất

您可以在 jQuery 中使用dialog follow this link to view或者您可以在代码中使用,例如

var childNode= window.open('/uri of child');

và sau đó sử dụng

childNode.onunload = function(){  
// code after child closed
}

如果没有的话你也可以尝试

window.onunload = function() {if(!window.opener.closed && childNode.closed){
//code after child closed
}}

关于javascript - 在父选项卡(页面)上显示叠加层,直到打开其所有子选项卡(页面),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32986801/

25 4 0
Walker 123
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress