【问题标题】:Can I show twitter feed in bootstrap popover?我可以在引导弹出窗口中显示 Twitter 提要吗?
【发布时间】:2018-08-22 08:21:02
【问题描述】:

是否可以在 bootstrap 的弹出框内显示 twitter 提要? 例如,当点击 twitter 按钮时,我希望我的网站的 twitter 提要显示在引导程序的弹出框内。

我已经尝试过下面的代码,但无法正常工作。任何帮助将不胜感激。

<a href="#" role="button" class="btn popovers" data-toggle="popover" title="" data-content=" <a class='twitter-timeline' data-chrome=nofooter noborders transparent data-width='250' data-height='350' href='https://twitter.com/myPage ref_src=twsrc%5Etfw'>Tweets by myPage</a>" data-original-title="test title">Test Button</a>

$("[data-toggle=popover]")
            .popover({
                html: true
            });

【问题讨论】:

    标签: html css twitter-bootstrap twitter


    【解决方案1】:

    伟大的作品

    试试这个小提琴

    HTML

    <h1> TWEET FEED IN BOOSTRAP POPOVER </h1>
    
    <div><button id="target">TRY ME</button></div>
    
     <!-- This will be the contents of our popover -->
     <div class='_content' id='blah'>
      **** YOUR TWITTER EMBEDDED CODE *****
    
     </div>
    

    JAVASCRIPT

    $(document).ready(function() {
    
    // We don't want to see the popover contents until the user clicks the target.
    // If you don't hide 'blah' first it will be visible outside of the popover.
    //
    $('#blah').hide();
    
    // Initialize our popover
    //
    $('#target').popover({
        content: $('#blah'), // set the content to be the 'blah' div
        placement: 'bottom',
        html: true
    });
    // The popover contents will not be set until the popover is shown.  Since we don't 
    // want to see the popover when the page loads, we will show it then hide it.
    //
    $('#target').popover('show');
    $('#target').popover('hide');
    
    // Now that the popover's content is the 'blah' dive we can make it visisble again.
    //
    $('#blah').show();
    
    
    });
    

    小提琴 https://jsfiddle.net/exaland/34ykLLLr/2/

    【讨论】:

    • 是的,我已经看过这个并且尝试了几乎所有方法,但没有任何效果。
    • 我只是做这个,请解释我或修改这个小提琴jsfiddle.net/YsEqb
    • 您正在做的是在弹出框内显示 HTML,我也可以这样做。我想要的是在弹出框内显示实时 Twitter 提要(dev.twitter.com/web/embedded-timelines)。
    • 我刚刚编辑了我的第一个答案,请欣赏并评价我:)
    猜你喜欢
    • 1970-01-01
    • 2020-08-01
    • 1970-01-01
    • 2013-04-12
    • 2017-02-20
    • 2015-02-16
    • 2012-10-28
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多