2014-06-17 1 views
0

나는 fancybox를 사용하여 팝업에 팝업 비디오를 표시하고, fb 공유와 같은 버튼을 사용했지만, 공유 버튼을 클릭하면 브라우저 팝업에서 열리고 fancybox에서 열리고 싶습니다. 라이트 박스를 사용하여 일관성을 유지합니다.팝업에서 팝업 - 팬시 박스

나는 브라우저 팝업 대신 팝업으로 페이스 북 공유 대화 상자를 표시하는 방법을 알아 낸다.

$('.fancybox-media') 
    .attr('rel', 'media-gallery') 
    .fancybox({ 
    href: $(this).attr('href'), 
    openEffect: 'none', 
    closeEffect: 'none', 
    prevEffect: 'none', 
    nextEffect: 'none', 
    autoDimensions: false, 
    padding: [15, 15, 0, 15], 

    height: 370, 
    width: 490, 

    arrows: false, 
    helpers: { 
     media: {}, 
     buttons: {}, 
     title: { 
      type: 'inside' 
     } 
    }, 

    beforeShow: function() { 
     if (this.title) { 

      this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=http:' + this.href + '&amp;layout=button&amp;show_faces=false&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px; float:right;" allowTransparency="true"></iframe>'; 
      this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=http:' + this.href + '&amp;layout=button&amp;show_faces=false&amp;width=500&amp;share=true&amp;action=like&amp;font&amp;colorscheme=light&amp;height=30" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px; float:left;" allowTransparency="true"></iframe>'; 
     } 

    } 
}); 

답변

0
나는 어떻게 브라우저 팝업 대신 팝업으로 페이스 북 공유 대화 상자를 표시 할까?

수 없습니다.

Facebook은 로그인 페이지가 iframe 안에 포함되도록 허용하지 않습니다. 이 빈 창을 반환

<iframe src="https://www.facebook.com/login.php"></iframe> 

을 참조하십시오 (이 fancyBox는 공유 버튼을 클릭하면 수행하려고 할 것입니다) JSFIDDLE