2012-11-18 55 views
0

我有一个照片库fancybox,当fancybox是在tittle外面打开看起来像一个按钮。问题是,这是行不通的。按钮像Facebook不敢与fancybox工作

这里我JS:

$(".fancyboxi").fancybox({ 
    padding: 0, 
       openEffect : 'none', 
       closeEffect : 'none', 

       prevEffect : 'none', 
       nextEffect : 'none', 

       closeBtn : true, 
      helpers: { 


       overlay: { 

         css: {'background-color': '#333'} 
        }, 
       title : { 
        type: 'outside' 
       } 
      }, 

      beforeShow: function() { 
      if (this.title) { 
       var titulo=this.href; 

       // Add tweet button 
    this.title += '<a href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-url="http://kingpollo.it/'+ titulo + '">Tweet</a>'; 

      // Add FaceBook like button 
       this.title += '<iframe src="//www.facebook.com/plugins/like.php?href=http://kingpollo.it/'+ titulo + '&amp;layout=button_count&amp;show_faces=true&amp;width=500&amp;action=like&amp;font&amp;colorscheme=light&amp;height=23" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:110px; height:23px;" allowTransparency="true"></iframe>'; 


      } 
     }, 

     afterShow: function(){ 
      twttr.widgets.load(); 
     }, 
     nextEffect: 'fade', 
     prevEffect: 'fade' 

    }); // fancybox}); 

Twitter的按钮正常工作。为什么FB按钮没有?

+0

你能提供链接问题或复制问题的小提琴吗? –

+0

http://kingpollo.it/elaborati.php(网页是underconstruction:P) – berti

+0

我可以看到FB按钮,有什么问题? –

回答

0

把完整的URL为Facebook按钮:

<a title="1st title" class="fancybox" href="/images/pic1_full.jpg"> 
<img alt="Photo number 1" src="images/pic1.jpg" 

不工作,但:

<a title="1st title" class="fancybox" href="http://www.yousite.com/images/pic1_full.jpg"> 
<img alt="Photo number 1" src="images/pic1.jpg" 

作品

+0

请使用编辑器的代码高亮工具。 – stefan

1
// Add FaceBook like button 
this.title += '<iframe src="//www.facebook.com/ 

的那部分代码缺少正确fb网址。

// Add FaceBook like button 
this.title += '<iframe src="http://www.facebook.com/