How to use Twitter Bootstrap ScrollSpy to execute a function

I would like to load more data after ScrollSpy receives a notification. But I do not see how to capture this event and execute a function.

+5
source share
3 answers

UPDATED Now this trigger has been included in the main assembly. You can see it in full. http://twitter.github.com/bootstrap/javascript.html#scrollspy

There is an update in the github work branch that will activate the activation callback.

References

As soon as you take an activating trigger, you can call it like this:

$("#nav li").on('activate', function() {
   //do stuff
});
+12
source

3 : docs)

$('#myScrollspy').on('activate.bs.scrollspy', function () {
  // do something…
})
0

Bootstrap 4 (beta 3):
Scrollspy Bootstrap 3. Events Scrollspy, activate.bs.scrollspy - data-spy="scroll" - , Scrollspy. :

$('[data-spy="scroll"]').on('activate.bs.scrollspy', function(event) {
    console.log('activate.bs.scrollspy', event);
})

!
, Scrollspy <body>, activate.bs.scrollspy window.
, Scrollspy :

$(window).on('activate.bs.scrollspy', function (event) {
    console.log('activate.bs.scrollspy', event);
})
0

All Articles