Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript ScrollSpy.js (Multiple Data Targets) Reply To: ScrollSpy.js (Multiple Data Targets)

#185909
mikeabrams
Participant

The function

$("body").scrollspy({ target: ".scrollspy" });

applies the “active” class to each li on scroll. The main point here is I am trying to change the target to:

$("body").scrollspy({ target: ".scrollspy2" });

when the new navbar/content is shown, but it seems to have no effect.