本文介绍了显示新的Facebook JavaScript SDK中的弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我曾经在我的网站上有一个 href 当用户点击它时,一个多方选择器显示,所以他们可以邀请他们的朋友到我的网站。 这是使用以下代码完成的:I used to have an href in my website. When users clicked on it, a multi-friend selector showed so they could invite their friends to my website.That was done using the following code: FB.ensureInit(function() { var dialog = new FB.UI.FBMLPopupDialog('XXXXXXX', ''); var fbml = 'Multi-Friend-Selector FBML' dialog.setFBMLContent(fbml); dialog.setContentWidth(620); dialog.setContentHeight(570); dialog.show(); });现在,我正在使用新的JavaScript SDK( http://connect.facebook.net/en_US/all.js ),但旧的方法不存在... 如何使用新的SDK?Now, I'm using the new JavaScript SDK (http://connect.facebook.net/en_US/all.js), but the old methods are not present...How can I do it with the new SDK?推荐答案是的,终于有了令人烦恼的框来调整大小从原来的964像素:Yes, finally got the irritating box to resize from the original 964 pixels:为了兼容性(让我们希望将来会得到修正或记录更好)我仍​​然说For compatibility (let's hope it will get fixed in the future, or documented better)I still saysize:(width:600,height:500),但是,我将宽度和高度作为父对象的属性分解,所以最终使用:but then I break out width and height as properties of parent object, so in the end use:size:(width:600,height:500),width:600,height:500, ...现在也可以使用您选择的JavaScript库来调整大小,也就是说,这里是一个jQuery调整大小的示例:And now it's also resizable with the JavaScript library of your choice, that is, here's a sample with jQuery resizing:FB.ui({ method: 'fbml.dialog', fbml: ( '<div style="width:480px;border:1px black solid;">A small JavaScript library that allows you to harness ' + 'the power of Facebook, bringing the user\'s identity, ' + 'social graph and distribution power to your site.</div>' ), size: {width:640,height:480}, width:640, height:480});$(".FB_UI_Dialog").css('width', $(window).width()*0.8); // 80% of window width// I'm also sure you could stack this call if you wanted to 这篇关于显示新的Facebook JavaScript SDK中的弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-30 23:53