Scrollspy constructor

Scrollspy(
  1. Element element, {
  2. String? target,
  3. int offset = 10,
})

Construct a Scrollspy object and wire it to element.

Implementation

Scrollspy(Element element, {String? target, int offset = 10}) :
this.offset = offset,
_body = document.body,
_$body = $(document.body),
_selector = "${target ?? element.attributes['href'] ?? ''} .nav li > a",
_$scrollElement = element is BodyElement ? $window() : $(element),
super(element, _name) {
  _$scrollElement.on('scroll.scroll-spy.data-api', (QueryEvent e) => _process());
  refresh();
  _process();
}