Bootstrap jsSocials PopOver

时间:2018-01-24 16:31:10

标签: javascript jquery twitter-bootstrap share popover

如何将文本从jsSocial呈现为popover?

这是html:在data-content中,必须呈现id=udostepnij的代码

<a href="#" data-html="true" title="Udostępnij" data-toggle="popover"
data-trigger="focus" data-content="<div id='udostepnij'></div>">
    <span class="fa fa-share"></span> Udostępnij
</a>

这是JavaScript:

$("#udostepnij").jsSocials({
    showLabel: false,
    showCount: false,
    shares: ["twitter", "facebook", "googleplus", "vkontakte", "pinterest", "stumbleupon", "whatsapp", "email", "reddit"],
    shareIn: "popup"
});
$("[data-toggle=popover]").popover();

有谁知道怎么连接?

1 个答案:

答案 0 :(得分:0)

我能够解决问题:

HTML:

<a href="#" data-html="true" data-placement="top" title="Udostępnij"
    data-toggle="popover" data-trigger="focus" data-content="<div id='udostepnij'></div><script>
    $('#udostepnij').jsSocials({
    showLabel: false,
    showCount: false,
        shares: ['twitter', 'facebook', 'googleplus', 'vkontakte', 'pinterest', 'stumbleupon', 'whatsapp', 'email', 'reddit', 'blogger'],
        shareIn: 'popup'
    });
    </script>"><span class="fa fa-share"></span> Udostępnij</a>

JavaScript的:

$("[data-toggle=popover]").popover();