2013-01-02 1 views
0

jquery 및 colorbox 라이트 박스 플러그인을 사용하여 ligthbox에서 iframe을 엽니 다.colorbox - 부모 iframe을 닫고 새 iframe 라이트 박스 열기

문제는 : 나는 버튼을 클릭

  1. 는 메인 iframe이 라이트 박스 안에 내 주요 iframe이 라이트 박스
  2. 를 엽니 다 - 버튼을 클릭하면, 그것은 닫아야합니다
  3. .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> 

답변

0

나는 그것을 고정을,하지만 난 여전히 뭔가가 필요 기분이^_^Internet Explorer 8 이하에서 작동하지 않습니다., 누구나 할 수 있기를 바랍니다. 그걸로 나까지?

$(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() { 

     $.colorbox({href:"faq.html", iframe:true, open:true}); 
    }) 
}); 
+0

는 다음과 같은 요소에'colorbox'을 첨부하지보십시오 :)하십시오 :'$의 .colorbox ({iframe이 : 사실, HREF : yourUrl});'. 그리고'click' 함수의 마지막에 누락 된';'을 고칩니다. –

+0

방금 ​​테스트했는데 IE9의 Firefox에서만 작동하며 Chrome이나 IE8에서는 작동하지 않습니다. – STEEL