【问题标题】:LinkedIn Button delay in apparition even after use of done() function?即使在使用 done() 函数之后,LinkedIn 按钮也会出现延迟?
【发布时间】:2013-04-01 15:12:39
【问题描述】:

在我看来,LinkedIn 按钮与其他按钮相比总是表现出一种奇怪的态度。

这次的问题是幻影出现的延迟,即使使用了 done() 函数:

    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。

一切正常,除了 LinkedIn 按钮。为方便起见,CreateNewLinkedinButton() 代码为:

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>

我已经发布了关于:Do not show social buttons (loaded via jquery) till they all are completely loaded 的帮助,并获得了一项帮助,该帮助适用于除 LinkedIn 之外的所有社交按钮。

提前感谢您宝贵的时间

【问题讨论】:

    标签: javascript jquery wordpress linkedin social


    【解决方案1】:

    我不知道如何表达:但问题自己解决了,没有任何改变。

    也许这是 LinkedIn 的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-07
      • 2020-06-26
      • 2021-01-23
      • 1970-01-01
      相关资源
      最近更新 更多