I am trying to remove bootstrap carousel on a button click and displaying all the lists in carousel
after i executed this code:
$('#carousel-on-22').removeAttr('data-ride');
$('#carousel-on-22').children().removeAttr('role');
$('#carousel-on-22').children().removeAttr('class');
$('#carousel-on-22').removeAttr('class');
$('#carousel-on-22').children().children().each(function () {
$(this).removeClass('carousel-item');
$(this).removeClass('active');
});
all events of bootstrap carousel events are still associated with it. How to remove all these events?
You can remove event click
or any other associated event to this element like so:
$("#carousel-on-22").unbind(); //Remove all events
$("#carousel-on-22").unbind('click'); //Remove `click` event only
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.