javascript - Facebook share not working in mobile fancybox -
updating issue:
we have facebook share feature appears on page , in fancybox.
desktop: works on both page , fancybox.
mobile: when on page, opens fb popup unusable - e.g. has "login facebook" text no clickable button. when on fancy box (i.e. there popup), clicking share link nothing.
thanks in advance ideas , help.
<?php if ($this->is_facebook && $this->oauth_fb_key) { ?> <meta property="fb:app_id" content="<?php echo $this->oauth_fb_key; ?>"/> <meta property="og:site_name" content="<?php echo $this->site_name; ?>"/> <meta property="og:url" content="<?php echo $this->item['url']; ?>"/> <meta property="og:title" content="<?php echo $this->item['title']; ?>"/> <meta property="og:description" content="<?php echo $this->item['description']; ?>"/> <meta property="og:image" content="https:<?php echo $this->item['image']; ?>"/> <?php if ($this->og_namespace) { ?> <meta property="og:type" content="<?php echo $this->og_namespace; ?>:<?php echo $this->og_recipe; ?>"/> <?php } else { ?> <meta property="og:type" content="website"/> <?php } ?> <?php } ?> <?php if ($this->oauth_fb_key) { ?> <script type="text/javascript"> var loaded_fb = loaded_fb || false; head.ready('jquery', function() { $(document).ready(function() { jquery.ajax({ type: "post", url: 'https://graph.facebook.com', data: { id: '<?php echo $this->item['url']; ?>', scrape: true }, success: function(result) { console.log(result); }, async: false }); var li = $('.facebook-share-button'); button = $('<li class="facebook-share-button"><div class="fb-like" data-href="<?php echo $this->item['url']; ?>" data-send="false" data-layout="button_count" data-width="100" data-show-faces="false"></div></li>'); if (li.size()) { li.remove(); } button.prependto('.event-load-buttons'); if (!loaded_fb) { window.fbasyncinit = function() { fb.init({ appid: '<?php echo $this->oauth_fb_key; ?>', status: true, cookie: true, xfbml: true }); }; // load sdk asynchronously (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"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk')); loaded_fb = true; } else { var interval = setinterval(function() { if (typeof fb !== 'undefined') { fb.xfbml.parse(); clearinterval(interval); } }, 20); } }); }); </script> <?php } ?>
Comments
Post a Comment