LinkedIn按钮在使用done()函数后延迟显示? [英] LinkedIn Button delay in apparition even after use of done() function?
问题描述
LinkedIn按钮在我看来总是表现出与其他按钮相比的奇怪态度。
LinkedIn Button is always showing, in my consideration, a weird attitude in comparison with other buttons.
这一次的问题是,即使是使用done()函数:
The issue this time, is the delay in apparition, even after use of done() function:
function CreateNewsocial(str)
{
$(".dd_outer").fadeOut("slow");
CreateNewLikeButton(str);
$.when(CreateNewTweetButton(str),CreateNewPlus1Button(str),CreateNewLinkedinButton(str),CreateNewSuButton(str)).done(function(){
$(".dd_outer").fadeIn('slow');
});
}
其中:
- dd_outer是社交按钮的包装div。
-
CreateNewLikeButton()
,CreateNewTweetButton()
,
CreateNewPlus1Button()
CreateNewLinkedinButton()
和
CreateNewSuButton()
是通过Ajax加载另一个Wordpress帖子时动态更新
社交按钮的函数。str
是传递的参数,
包含帖子的ID。
- dd_outer is the wrapping div of social buttons.
CreateNewLikeButton()
,CreateNewTweetButton()
,CreateNewPlus1Button()
CreateNewLinkedinButton()
, andCreateNewSuButton()
are functions that are dynamically updating social buttons when loading another Wordpress post via Ajax.str
is the passed parameter and contains the ID of post.
Everthing工作正常,除了LinkedIn按钮。为了便于获取信息,CreateNewLinkedinButton()代码为:
Everthing is working ok, except for the LinkedIn button. For the sake of information, CreateNewLinkedinButton() code is:
function CreateNewLinkedinButton(str)
{
var elem3 = $(document.createElement("script"));
elem3.attr("type","IN/Share");
elem3.attr("data-url","http://website/Arra2issia/"+str+"/");
elem3.attr("data-counter", "top");
$("#linkedin").empty().append(elem3);
return $.getScript("http://platform.linkedin.com/in.js?async=true", function() {
IN.init();
});
}
和HTML是:
<div id="linkedin"><script type="IN/Share" data-url="<?php the_permalink();?>" data-counter="top"></script></div>
我已经发布过:不显示社交按钮(通过jquery加载)直到它们全部被加载并获得了除LinkedIn之外的所有社交按钮都能正常工作的帮助。
I have already posted about: Do not show social buttons (loaded via jquery) till they all are completely loaded and got a help which worked fine for all social buttons except LinkedIn one.
提前感谢您的宝贵时间
推荐答案
我不知道如何表达它:但问题是自己解决的,没有改变任何东西。
I don't know how to express it: but the problem is resolved itself, without changing anything.
也许这是一个LinkedIn问题。
Maybe It was a LinkedIn problem.
这篇关于LinkedIn按钮在使用done()函数后延迟显示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!