Javascript 如何卸下引导转盘
我试图删除一个按钮点击引导旋转木马,并显示在旋转木马中的所有列表 这是它以前的样子: 执行此代码后:Javascript 如何卸下引导转盘,javascript,jquery,twitter-bootstrap,Javascript,Jquery,Twitter Bootstrap,我试图删除一个按钮点击引导旋转木马,并显示在旋转木马中的所有列表 这是它以前的样子: 执行此代码后: $('#carousel-on-22').removeAttr('data-ride'); $('#carousel-on-22').children().removeAttr('role'); $('#carousel-on-22').children().removeAttr('class'); $('#carousel-on-22').removeAttr('
$('#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');
});
这就是它的样子;
引导转盘事件的所有事件仍与之关联。
如何删除所有这些事件?您可以删除此元素的事件单击或任何其他关联事件,如下所示:
$("#carousel-on-22").unbind(); //Remove all events
$("#carousel-on-22").unbind('click'); //Remove `click` event only
您可以删除此元素的事件单击或任何其他关联事件,如下所示:
$("#carousel-on-22").unbind(); //Remove all events
$("#carousel-on-22").unbind('click'); //Remove `click` event only