在 iframe 父级中访问 div [英] access div in iframe parent

查看:27
本文介绍了在 iframe 父级中访问 div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含 iframe 到另一个页面的页面,我正在寻找的是单击 iframe 内的某些内容,然后可以访问或更具体地隐藏父级中的 div.我知道一些 JQuery,但出于某种原因,当我尝试自己编写代码时,只是呆呆地坐在那里

I have a page which contains an iframe to another page, what I am looking for is to click something inside the iframe, which can then access or more specifically hide a div in the parent. I know some JQuery but for some reason just sit there blankly at the code editor when I try to write it on my own

推荐答案

在 iframe 中试试这个:

try this in iframe:

$('#DIVtobehidden', window.parent.document).hide();

这篇关于在 iframe 父级中访问 div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆