自定义滚动条与Facebook的评论 [英] Custom Scrollbar with Facebook comments

查看:116
本文介绍了自定义滚动条与Facebook的评论的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目标



我想在 Facebook注释容器中加载窗口时运行滚动条。



问题



滚动条运行良好,但我必须调整屏幕以强制其调用。



场景



我做了 jsFiddle的一个例子(看看!),说明当前的情况。



有两层:


  1. .comments - 工作,但您需要调整窗口大小;

  2. .example - 无缝工作。 >

所以我问:有人知道一些技巧来解决我的问题?提前感谢!

解决方案

您需要打开updateOnContentResize,因为它是在滚动条初始化后加载的iframe。



{pre> $(。comments)。mCustomScrollbar({
theme:dark,
advanced:{
updateOnContentResize:true
}
});

这是编辑的小提琴 http://jsfiddle.net/vDUyU/1/


The goal

I want to run a scrollbar when a window load within a Facebook comments' container.

The problem

The scrollbar works well, but I have to resize the screen to force its invocation.

The scenario

I made an example on jsFiddle (take a look!) illustrating the current scenario.

There are two layers:

  1. .comments — works but you need to resize the window;
  2. .example — works seamlessly.

So I ask: someone knows some trick to resolve my problem? Thanks in advance!

解决方案

You need to turn on updateOnContentResize because it is an iframe that gets loaded after the scrollbar has initialised.

$(".comments").mCustomScrollbar({
    theme: "dark",
    advanced:{
        updateOnContentResize: true
    }
});

Here is the edited fiddle http://jsfiddle.net/vDUyU/1/

这篇关于自定义滚动条与Facebook的评论的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆