繁体   English   中英

分享这不起作用

[英]sharethis is not working

我在我的网站上使用Sharethis

这是我添加的代码

<script type="text/javascript">var switchTo5x=true;</script>
<script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script>
<script type="text/javascript">stLight.options({publisher: "45bd003e-483d-41ec-9f43-b7c7bff3e9b1", doNotHash: false, doNotCopy: false, hashAddressBar: false, onhover:false});</script>

这是在我的主要HTML

在当前的HTML我有这个

<a class="st_sharethis_custom" st_title="{{profile.displayName}} Profile" st_image="{{profile.profileImage}}" ng-if="loggedIn"><span class="glyphicon glyphicon-share"></span><em>SHARE</em></a>

现在的问题是,当我转到该特定页面时,glyphicon正在加载,但是在该共享上单击时这不起作用,但是如果我刷新则它正在起作用

表示第一次加载页面时它不起作用,但是刷新后它正在起作用。

有人可以提前帮助我吗

添加此js函数

$scope.initShare = function() {
        stButtons.locateElements();
    };

并将ng-init添加到元素

<a ng-init="initShare()" class="st_sharethis_custom"><img src="resources/scripts/lib/images/share.png" class="icons-s" ></a>

然后就可以了...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM