Bootstrap 4 - 手风琴不工作 hover/as 预期悬停
Bootsrap 4 - Accordion not working on hover/as expected on hover
我正在尝试在悬停时转换 bootastap 4 手风琴,是的,我做到了,但完全没有按预期工作。
这是我的代码
$('.accordion .card-header button').on('mouseenter', function(event) {
event.preventDefault();
$( '.accordion .card' ).children('.collapse' ).collapse('show');
})
这里是 codepen
这里有一个不那么冗长的方法...
$('[data-toggle="collapse"]').on('mouseenter', function() {
$(this).parents('.card').find('.collapse').collapse('show');
})
我正在尝试在悬停时转换 bootastap 4 手风琴,是的,我做到了,但完全没有按预期工作。
这是我的代码
$('.accordion .card-header button').on('mouseenter', function(event) {
event.preventDefault();
$( '.accordion .card' ).children('.collapse' ).collapse('show');
})
这里是 codepen
这里有一个不那么冗长的方法...
$('[data-toggle="collapse"]').on('mouseenter', function() {
$(this).parents('.card').find('.collapse').collapse('show');
})