如何将自定义滚动条应用于Google Maps信息窗口

时间:2015-10-11 10:45:58

标签: javascript jquery google-maps-api-3 infowindow custom-scrolling

当内容不适合窗口时,我有infowindow使用垂直滚动条。我想使用细圆滚动条将jquery custom scrollbar应用于infowindow(我认为它是默认皮肤)。

查看小提琴here。我添加了所有必需的代码,但仍然显示默认滚动条。

装载:

$(document).ready(function () {
    $(".mapInfoWindow").customScrollbar();
});

添加皮肤:

content: '<div class="mapInfoWindow modern-skin">'...

CSS:

.mapInfoWindow {
    max-height: 100px;
}

编辑: 在下面的答案之后,滚动条现在在底部被切断,请按照要求查看下图:

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以使用setInterval来调用customScrollbar并将jQuery Custom Scrollbar css文件链接到您的项目。

setTimeout(
    function()
    {
     $(".mapInfoWindow").customScrollbar();
    }, 3000
);

Link