admin管理员组文章数量:1289832
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
/
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/5J852/
- Have you seen this one stackoverflow./questions/10719931/… ? – AndrewPolland Commented May 30, 2014 at 13:13
3 Answers
Reset to default 4You can also try this
$(document).ready(function(){
$( ".accordion-toggle" ).mouseover(function(){
$( ".accordion-toggle" ).trigger( "click" );
// If creating multiple accordion items, use the below to prevent all other
// items with the class "accordion-toggle" triggering a click event
// $(this).trigger("click");
});
});
check this fiddle
i Guess this is a dirty way to do it..
http://jsfiddle/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/5J852/4/
本文标签: javascriptBootstrap accordion open on hoverStack Overflow
版权声明:本文标题:javascript - Bootstrap accordion open on hover - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741466963a2380368.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论