简体   繁体   中英

Bootstrap accordion open on hover

I already tried other examples that I found from Google and SO but can get any to execute so I was trying this silly solution for opening the Bootstrap accordion on hover but it doesn't want to work either... any suggestions?

HTML

<nav class="nav">
<ul>
<li><a class="accordion-toggle" data-toggle="collapse" data-trigger="hover" data-parent="#submenu" href="#one">SHOW</a></li>
</ul>
</nav>


<div id="one" class="collapse">
<div class="accordion-inner">
HERE IS THE STUFF
</div>
</div>


jQuery

$('#submenu').collapse({ trigger: "hover" })


FIDDLE

http://jsfiddle.net/5J852/

You can also try this

$(document).ready(function(){
$( ".accordion-toggle" ).mouseover(function(){
   $( ".accordion-toggle" ).trigger( "click" );
});
});

check this fiddle

i Guess this is a dirty way to do it..

http://jsfiddle.net/5J852/16/

by already using the built in event trigger

$('.nav a').mouseover(function(){
    $( this ).click();
});
$('.nav a').mouseout(function(){
    $( this ).click();
});

See if this helps

$('.accordion-toggle').hover(function(){
    $(this).click();
});

http://jsfiddle.net/5J852/4/

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM