Currently the events triggered by ScrollSpy do not bubble because they are triggered by the jQuery's .triggerHandler method which (according to the docs) is similar to .trigger() but one of the exceptions is the following:
Events triggered with .triggerHandler() do not bubble up the DOM hierarchy; if they are not handled by the target element directly, they do nothing.
Unfortunately, for me it's an issue. Sometimes in my applications (PhiDo, for example) I have to initiate scrollspying on hundreds of elements. Installing a separate event handler on each of these elements (instead of only one handler on a parent element) seems superfluous.
Hence a pull request to replace .triggerHandler with a simple .trigger.
(Also fixes #8 because is based on its code branch.)
Currently the events triggered by ScrollSpy do not bubble because they are triggered by the jQuery's
.triggerHandler
method which (according to the docs) is similar to.trigger()
but one of the exceptions is the following:Unfortunately, for me it's an issue. Sometimes in my applications (PhiDo, for example) I have to initiate scrollspying on hundreds of elements. Installing a separate event handler on each of these elements (instead of only one handler on a parent element) seems superfluous.
Hence a pull request to replace
.triggerHandler
with a simple.trigger
.(Also fixes #8 because is based on its code branch.)