LinkedIn Button delay in apparition even after use of done() function?

不打扰是莪最后的温柔 提交于 2019-12-02 07:32:29

问题


LinkedIn Button is always showing, in my consideration, a weird attitude in comparison with other buttons.

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');
                       });

    }

Where:

  • dd_outer is the wrapping div of social buttons.
  • CreateNewLikeButton(), CreateNewTweetButton() , CreateNewPlus1Button() CreateNewLinkedinButton() , and CreateNewSuButton() 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 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();
  });
        }   

and HTML is :

<div id="linkedin"><script type="IN/Share" data-url="<?php the_permalink();?>" data-counter="top"></script></div>

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.

Thank you in advance for your valuable time


回答1:


I don't know how to express it: but the problem is resolved itself, without changing anything.

Maybe It was a LinkedIn problem.



来源:https://stackoverflow.com/questions/15746030/linkedin-button-delay-in-apparition-even-after-use-of-done-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!