
After been doing a lot of work on the site I noticed when testing in IE8 and Firefox 3.6.x that I was the proud winner of a vertical scroll-bar. Spending hours to figure out why the page suddenly had become about 300 pixels wider I found that the problem had to do with the Facebook Like Button code.
This is not a problem if you one uses the iframe code, but using the iframe solutions also means a static height whereas the height is automatically adjusted when using XFBML code. So after been playing around with XFBML code I figured out that it was the div fb-root which was causing the problem and the solution was to hide it.
Shown below is the XFBML code which creates the Facebook Like Button and the solution to the vertical scroll-bar bug. This solution has been tested in Chrome, Firefox, IE8, IE9, Safari and Opera (which is actually a really nice browser). This is isn’t tested for IE7, but the like from a IE7 user isn’t that important ; )
XFBML code
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#appId=251259271567761&xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
// ]]></script>
Solution
Set div fb-root css to display:none in your style-sheet.
display: none;
}




Posted in
Tags:
«







man you rock its working for my facebook like box