fb like button creates a white background on page onload in all ie versions

后端 未结 4 701
萌比男神i
萌比男神i 2020-12-11 17:14

I have added the facebook like button .

When my

4条回答
  •  误落风尘
    2020-12-11 18:03

    Simply hide the container with CSS and then display it once the iframe has loaded, this can be done two ways:

     /* Hide container */
    
    
    

    If you are not using this FB.XFBML.parse() function then you can subscribe an event when everything has rendered instead:

    window.fbAsyncInit = function () {
            FB.init({
                appId: 'APP_ID',
                xfbml: true
            });
    
            FB.Event.subscribe('xfbml.render',
                function () {
                     $('#fblike').css({'visibility':'visible'}); /* Show container once loaded */
                }
            );
        };
    

    Took me a while to find this all out! Here is a link to where I found my solution: http://developers.facebook.com/docs/reference/javascript/FB.Event.subscribe/

提交回复
热议问题