Slow to load facebook like button

Asked

Viewed 278 times

1

I have a div where you can find the social media section. I have a Facebook, Twitter and Google Plus like button.

The Twitter and Google Plus finish loading together and is shown, while the Facebook takes a few more seconds to load.

I’d like to put a pulse on that div and when you’re loaded you can show them all, all at once.

It is possible?

2 answers

1

First leave your div main with opacity:0. Then use Jquery to check if the Facebook button has been pressed and finally make all appear together.

Example:

$( ".facebook").load(function() {
    $(this).parent().fadeTo( "fast" , 1);
});
  • $( ".facebook").ready? That doesn’t work no, just the document has this event.

  • Really, it was a mistake. I’ve edited, thanks.

0

With the div, I’m not sure there’s a way. But if you use directly the generated iframe of the respective buttons you can delegate a load event normally to them as to a common window.

  • I couldn’t get Diego to please edit this Jsfiddle with your idea? http://jsfiddle.net/C3LMR/

  • 1

    Jefferson by code are not iframes, but codes that are loaded by scripts of these networks. Could you check their documentation to see if they offer an API that enables what you’re looking for? The ability to execute a function when the script is loaded is sufficient.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.