javascript - Hide social media buttons until all are loaded -


our site has 4 social media buttons:

  1. facebook
  2. twitter
  3. linkedin
  4. g+1

they load asynchronously , render @ different times after page load. want hide container initially, , show them @ same time after 4 loaded.

is there way check when 4 loaded, either on our site's code, or using api's twitter, google, etc..?

facebook , linked in render images, twitter , google "images" render within iframes either label tag twitter or svg google.

see https://stackoverflow.com/a/19355923/6599592

for imgs : (jquery version)

$('img').parent().css('display', 'none'); // hide container  var = 0;  $('img').each(function(){     $(this).load(function(){         i++;          if(i == $(this).parent().children().length) {             $(this).parent().css('display', 'block');         }     } }); 

Comments