Loading jScrollPane after initializing Facebook Comments - how?

雨燕双飞 提交于 2019-12-02 14:53:03

问题


Is there an "onComplete" state or similar for the Facebook Comments plugin? I'm trying to add a jScrollPane scrollbar to a content box that has FB Comments inside it. What happens is I get the FB Comments iframe placed on top of the box's content (as if it had an absolute position / was floating. Guessing this has to do with FB Comments initializing after jScrollPane.

Edit:

Now what I'm really after is combining ColorBox, Facebook Comments and jScrollPane and the headache starts pretty soon:

$('.mybox').colorbox({  innerWidth: 640, innerHeight: 480, scrolling: false, onComplete: function() {
    $('#cboxLoadedContent').jScrollPane({
// Init FB Comments here instead? Then call jScrollPane?
      showArrows: true,
      scrollbarWidth: 15,
      scrollbarMargin: 0
      });
    }, 
    onClosed: function() {
// What would happen here if I need to listen for FB Comments also?
      $('#cboxContent').jScrollPaneRemove(); 
    }
    });

Sorry if my question is a bit unclear, it's late and I've been in front of a screen for 10+ hours.


回答1:


Using the xfbml.render event:

FB.Event.subscribe('xfbml.render', function() {
    console.log('Loaded!');
});


来源:https://stackoverflow.com/questions/7628819/loading-jscrollpane-after-initializing-facebook-comments-how

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!