我正在使用 bootstrap,我正在尝试将子导航栏附加到侧面。 Bootstrap 的文档说 Options can be passed via data attributes or JavaScript.
他们提供的示例是 $('#navbar').affix()
,但是如何传递偏移量通过javascript选项? (比如从顶部偏移 200 像素)?
最佳答案
$('#navbar').affix({ offset: { top : 200 } });
关于javascript - 如何通过 JavaScript 为 Boostrap 的词缀设置选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16568298/