我在我的网站上使用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>现在的问题是,当我转到特定的页面时,字形图标正在加载,但单击该共享时,这不起作用,但如果我刷新,它就起作用了
意味着当我第一次加载页面时,它不工作,但在一次刷新后,它工作了。
有人能帮我提前说声谢谢吗?
发布于 2016-09-23 19:38:09
添加此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>然后它就能工作了..。
https://stackoverflow.com/questions/39617356
复制相似问题