PDA

View Full Version : facebook fan box


Chadi
07-23-2012, 10:20 PM
I inserted the code for facebook fan box in one of the forum blocks.

Problem is that it causes the horizontal scrollbar in the site to appear. Once the FB code is removed entirely, scrollbar disappears too. Reducing the width in the code doesn't do anything odd enough. I've tried widths as small as 200.

Using this code:

<div id="fb-root"></div>
<script>(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#xfbml=1&appId=";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like-box" align="center" data-href="http://www.facebook.com/talkjesus" data-width="230" data-height="480" data-show-faces="true" data-border-color="#ffffff" data-stream="false" data-header="false"></div>

Chadi
07-26-2012, 07:06 PM
Would appreciate help on this. Thanks

ForceHSS
07-26-2012, 08:05 PM
HTML or php what one did you pick

Chadi
07-26-2012, 08:12 PM
I chose html since there is no php in the code

Chadi
08-13-2012, 12:13 PM
Can someone please assist me on this? Thank you

ForceHSS
08-13-2012, 02:18 PM
I know there is no php in it but I am sure there is a php version

Lynne
08-13-2012, 02:46 PM
I can tell you right off the bat that that code will cause issues on your site if you are also using Facebook Connect. You cannot have two tags with the same id on a page.

Chadi
08-18-2012, 02:26 PM
Thanks Lynne. Any way to work around this?

Lynne
08-18-2012, 02:50 PM
Just change the id on this snippet. That may mean you need to write some custom css since there may be css written for that id already.

I just tried your code on my test site and I do not get a scroll bar at all. Can we get a link to see the problem on your site?

Chadi
08-18-2012, 03:07 PM
<a href="http://www.talkjesus.com/forum.php" target="_blank">http://www.talkjesus.com/forum.php</a>

Problem fixed. (Thanks Lynne)

Changed

<div id="fb-root"></div>

To

<div id="fb-root2"></div>

Lynne
08-18-2012, 04:34 PM
It looks fine to me on your site.

You've done a nice job with your site. :)

Chadi
08-18-2012, 05:14 PM
Thank you Lynne for your kind words :)