Scrollspy constructor
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();
}