0

我正在使用 Bootsrap 模式,我正在尝试在其中集成slimscroll插件。但它不起作用。

这是我的代码:

$("#refinequery").on('show.bs.modal', function (e) {

                var form = $(this).find('form');

                that.locationDetails(form, that.formInfo.disciplineProperties);
                that.queryDetails(form, that.bodyDetails );

                $('.modal-dialog').css({
                    height : $( window ).height()*1,
                    "overflow-y":'auto'
                });

            }).on('shown.bs.modal', function () {
                $(this).slimscroll({}); //not working properly all are collapsed!
            }).modal();
4

1 回答 1

0

您需要在初始化之前破坏您的模态与 slimScroll 的任何现有关系。以下适用于您的 CodePen 示例。

$("#myModal").on('show.bs.modal', function() {
  $('#myModal .modal-body')
    .slimscroll({ destroy: true })
    .slimscroll({ height: '500px' })
    .text(text);
});
于 2015-12-18T21:38:34.240 回答