$('body').scrollspy({
target: '#nav',
offset: $(window).height() / 2
});
报错:

 

首先检查自己引入jquery是不是在其他js语句之前。

其次想要使用scrollspy().必须提前 import bootstrap.min.js .

<script type="text/javascript" src="static/js/bootstrap.min.js"></script>

官网:https://getbootstrap.com/docs/4.0/components/scrollspy/

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-24
  • 2021-08-15
  • 2021-04-05
  • 2021-11-25
  • 2022-01-29
  • 2022-03-06
相关资源
相似解决方案