我的网站中有一个 iframe,并且想在 iframe 之外触发一个点击事件。iframe 作为灯箱加载,iframe 中有一个表单,我想在提交时关闭灯箱。
我使用此代码,但单击事件不起作用。当我在萤火虫中运行相同的代码时,灯箱成功关闭,但在这里我没有得到任何结果。
$('iframe', parent.document)
.parent('div#pp_full_res .pp_pic_holder')
.siblings('div.pp_details')
.find('a.pp_close')
.click();