0
jquery 및 colorbox 라이트 박스 플러그인을 사용하여 ligthbox에서 iframe을 엽니 다.colorbox - 부모 iframe을 닫고 새 iframe 라이트 박스 열기
문제는 : 나는 버튼을 클릭
- 는 메인 iframe이 라이트 박스 안에 내 주요 iframe이 라이트 박스
- 를 엽니 다 - 버튼을 클릭하면, 그것은 닫아야합니다
- .flash_shareable 클래스가 상위 (예 : 기본 iframe)을 열고 연결된 새 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});
})
});
HTML에서 메신저 다른은 Ligthbox 열려고 :
<button class="flash_shareable" type="button">open flash</button>
는 다음과 같은 요소에'colorbox'을 첨부하지보십시오 :)하십시오 :'$의 .colorbox ({iframe이 : 사실, HREF : yourUrl});'. 그리고'click' 함수의 마지막에 누락 된';'을 고칩니다. –
방금 테스트했는데 IE9의 Firefox에서만 작동하며 Chrome이나 IE8에서는 작동하지 않습니다. – STEEL