Understanding jQuery Named Events, Bootstrap

I understand how to trigger and listen to custom events. I can't figure out how Bootstrap listens for custom events without calling them.

https://github.com/twitter/bootstrap/blob/master/js/bootstrap-scrollspy.js#L32

Nowhere in my code can I find where they fire this custom scroll event. I took a look at the jQuery docs on

and couldn't see how the natural namespace comes about.

How it works?

+3


source to share


1 answer


They listen for a scroll event, which is a naturally occurring event . This is not an ordinary event, but just names. The reason for placing them in names is that you can remove all events by simply removing the namespace from all events. Have a look at Using Namespaces in unbind .



+3


source







All Articles