我有一个问题,无法摆脱它。我正在使用不同的 jquery 插件,例如:nanoScroller、iDangerous swiper 等。
我的问题是,当一个元素设置为不显示时,插件将无法工作,直到我调整屏幕大小或者如果我按 f12 插件才能工作。
我该如何解决这个问题?
最佳答案
尝试触发窗口调整大小事件:
$(window).trigger('resize');
如果你想在 bs modal 显示后初始化一些元素,使用 it's events :
$(document).on('show.bs.modal', '.modal', function () {alert('before modal show')});
关于jquery - 元素不显示时如何重新初始化插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30976926/