javascript
  • html
  • html5
  • twitter-bootstrap
  • 2013-02-13 266 views 2 likes 
    2

    我正在工作在一個涉及分享按鈕的頁面上,當點擊該按鈕時,彈出一個twitter引導彈出窗口,並在裏面是共享鏈接。Bootstrap彈出窗口鏈接不工作

    var content = '<a href="http://www.facebook.com/share.php?u='+link+'">Post to facebook</a><br>'; 
        content += '<a href="http://twitter.com/home?status='+link+'">Post to twitter</a><br>'; 
        $('.sharelist').popover({ 
         'title': 'Share this Playlist', 
         'placement': 'bottom', 
         'html': true, 
         'content': content 
        }); 
    

    它幾乎可以做到這一點。彈出的東西,鏈接在那裏,藍色,在它們上方盤旋,將光標變成一隻小手,但是當我點擊時,沒有任何反應!我可以右鍵單擊以在新選項卡中打開,並且鏈接再次運行。

    這是怎麼發生的?

    +1

    你應該使用'encodeURIComponent(link)' – 2013-02-14 00:04:43

    +0

    謝謝你的提示,傑克,但是這並不能解決問題。 – user1624005 2013-02-14 00:32:36

    +0

    我沒有看到您的代碼有問題。你可以創建一個[小提琴](http://jsfiddle.net/)的問題? – 2013-02-15 04:43:34

    回答

    0

    UPDATE:

    ADD A CLASS TO YOUR LINK NAMED "post-popover" and
    $(document).ready(function() { 
        $('.post-popover').popover({ 
        placement: 'bottom', 
        title: 'Share this Playlist', 
        content: 'content', 
        html: true, 
        trigger: 'click' 
        }); 
    

    });

    +0

    vr1911428這沒有奏效。我不知道它應該如何工作,我試着粘貼它,沒有任何改變。 – user1624005 2013-02-14 00:10:20

    +0

    感謝您再次嘗試vr1911428,但它仍然沒有工作 – user1624005 2013-02-14 01:01:09

    相關問題