Tuesday 25 February 2014

fb:share_button/fb:login_button/fb: failed to resize in 45s

I saw one strange issue while using fb_share button which I would like to share and How did I fix it.

When you use fb_share buttons with their stats, means you are using some javascript to get the starts and show beside of the button. When the page load it was working fine, but when you navigate to any other page by clicking on a link or button, and you do browser back to the same page again, it tries to load fb_share button again.. but it keep the textarea locked for 45 seconds, which was quite strange.

I guess it had to be with while fb tries to get the data it also tries to make the proper UI of the button, size and all, and during that period, it locks the textarea.

I started searching for the issue and got a pathetic solution on stackoverflow which says to use this css

.fb-share-button span,
.fb-share-button iframe {
    width: 120px! important;
    height: 25px! important;
}

And amazing part is, it works :)