noreiller / bootstrap-modal-carousel

A set of plugins to display a carousel into a fullscreen modal box
http://noreiller.github.com/bootstrap-modal-carousel
MIT License
128 stars 63 forks source link

Event detach.bs.local and replaced.bs.local of Modal-local not work? #26

Closed HBinhCT closed 7 years ago

HBinhCT commented 7 years ago

I read here and see Modal-local have 4 event type: detach.bs.local, detached.bs.local, replace.bs.local and replaced.bs.local. But in my code for testing, only detached.bs.local and replace.bs.local worked with alert. You can see here: https://jsfiddle.net/cr2ohy9v/ Sorry for my English not good. Thank you.

noreiller commented 7 years ago

Hi, the events are triggered on the carousel. So in your example, you can listen the events with:

$('#myCarousel').on('detach.bs.local', function() {
    alert('detach.bs.local');
});
$('#myCarousel').on('detached.bs.local', function() {
    alert('detached.bs.local');
});
$('#myCarousel').on('replace.bs.local', function() {
    alert('replace.bs.local');
});
$('#myCarousel').on('replaced.bs.local', function() {
    alert('replaced.bs.local');
});
HBinhCT commented 7 years ago

It worked. Thank you very much!