jamie
jamie

Reputation: 1

fb like + send button

I have the like and send button on the right side of my website. When I click on either buttons, it displays a box but it extends towards the right thus giving me horizontal scroll bars.

Is there a way to have the box extend towards the left?

Many thanks guys.

Upvotes: 0

Views: 722

Answers (2)

chwk
chwk

Reputation: 441

Is there a way to just simply 'like' without opening the box?

No. You can try to hide the box by enclosing the iframe with a div and setting the div's height to something suitable and its overflow property to hidden, but that's about it. You might want to file a feature request with Facebook.

Upvotes: 1

Richard
Richard

Reputation: 22016

I have looked at this before and it is a pain in the £%^^&! Unfortunately because the elements are in an iframe you can't use your own stylesheets to overwite the styles and move the popup left. Instead what I have done in the past is mimic the send button to the left of the like button and use the FB.UI method to show a popup centred window like so:

<script>
  $(function () {

                   $('#sendbutton').click(function (e) {
                       e.preventDefault();
                       FB.ui({
                           method: 'send',
                           name: 'Blah blah blah',
                           description: 'Description',
                           link: 'http://www.example.com',
                           image: 'http://www.example.com/content/images/image.png' 
                       });
                       return false;
                   });

               });
 </script>

<a id="sendbutton" href=""><img src="@(Url.Content("~/Content/Images/send.png"))" /></a>

don't forget you will need to initialise the Facebook javascript API first:

http://developers.facebook.com/docs/reference/javascript/

Upvotes: 1

Related Questions