鍍金池/ 問答/HTML/ JQ獲取iframe父級的父級

JQ獲取iframe父級的父級

在iframe中如何獲取上上級的iframe呢?
意思就是被嵌套在兩層iframe中。
因為我想在【上級】和【上上級】的iframe添加全屏的屬性
上級寫法如下:測試已經(jīng)生效
$('iframe', window.parent.document).attr("allowfullscreen","true");
上級的頁面仍在iframe中,如何選中上上級的iframe呢?

回答
編輯回答
尐潴豬

window.parent.parent.document

2017年3月9日 10:08
編輯回答
爆扎

window.top.top

2018年3月1日 02:56