0
我使用jQuery和colorbox lightbox插件在ligthbox中打开iframe。colorbox - 关闭父iframe并打开新的iframe lightbox
的问题是:
- 我点击按钮,它会打开我的主要的iframe收藏
- 主要IFRAME里面灯箱 - 有按钮,类.flash_shareable
- 当你点击,它应该关闭父级(即主iframe),然后打开一个新的iframe,它链接到
它是关闭父iframe,但它不打开新的iframe。
我的代码:
$(document).ready(function(){
var y = $(document.body).height();
var x = $(document).width();
parent.$.colorbox.resize({innerWidth:x, innerHeight:y});
$('.iframe').colorbox({iframe:true}); //ligthbox
$(".flash_shareable").click(function() {
parent.$.colorbox.close();
$.colorbox({href:"faq.html", iframe:true, width:800 + "px", height:600 + "px", open:true});
})
});
IFRAME的HTML,从中我试着去打开另一ligthbox:
<button class="flash_shareable" type="button">open flash</button>
尽量不要附加'colorbox'一个元素,如下所示:'$ .colorbox({IFRAME:真,HREF:yourUrl});'。并在'click'功能结束时修复丢失的';'。 –
我刚刚测试过,它只适用于Firefox n IE9,不适用于Chrome或IE8。 – STEEL