0

I have created a share_facebook function. When a user clicks the button, it will prompt them to log in to facebook and share our site. However, in the share dialog, there is a white space on the right that couldn't be eliminated. I am using the image size 1200x630px as recommended by facebook. Anyone here can help?

screen shot of the facebook share dialog

    (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/sdk.js";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));

      window.fbAsyncInit = function () {
        var appId = '1746827655661251';
        FB.init({
          appId: appId,
          xfbml: true,
          version: 'v2.9'
        });
      };

      function share_facebook()
      {
        event.preventDefault();
        event.stopPropagation();
        event.stopImmediatePropagation();

        // Dynamically gather and set the FB share data. 
        var FBDesc      = 'Water and Sump Pump Backup is an endorsement to the Homeowners Policy that is often forgot about by first time home buyers. A homeowners insurance policy in its standard form will not cover water that is “backed up” through a drain, toilet, etc';
        var FBTitle     = 'Welcome to my site';
        var FBLink      = 'https://www.mygreatsite.com/';
        var FBPic       = 'https://www.mygreatsite.com/images/home_feature2.jpg';

        // Open FB share popup d
        FB.ui({
            method: 'share_open_graph',
            action_type: 'og.shares',
            action_properties: JSON.stringify({
                object: {
                    'og:url': FBLink,
                    'og:title': FBTitle,
                    'og:description': FBDesc,
                    'og:image': FBPic
                }
            })
        },
        function(response)
        {
          //response codes
        });
       }
samlee32
  • 31
  • 4

1 Answers1

0

Solution found - instead of using method 'share_open_graph', I use 'share'.

samlee32
  • 31
  • 4