簡體   English   中英

像facebook這樣的按鈕不適用於fancybox

[英]button like facebook dosen't work with fancybox

我有一個帶有fancybox的相冊,當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按鈕?

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

該部分代碼缺少正確的fb url。

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

將完整的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"

作品

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM