Bootstrap——将菜单改为鼠标滑过(bootstrap-dropdown-hover插件)

廖永长
2023-12-01

官网:bootstrap-hover-dropdown

人生有限公司

<ul class="nav navbar-nav navbar-right">
<!-- 按钮1 -->
	<div class="btn-group">
		<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">公司首页</button>
	</div>

<!-- 按钮2 -->
	<div class="btn-group">
		<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" data-hover="dropdown">业务介绍</button>
	<ul class="dropdown-menu">
		<li><a href="https://www.csdn.net/" target="_blank">成名在望</a></li>
		<li><a href="https://v3.bootcss.com/" target="_blank">少年他的奇幻漂流</a></li>
		<li><a href="https://api.jquery.com/" target="_blank">转眼</a></li>
	</ul>
	</div>

<!-- 按钮3 -->
	<div class="btn-group">
		<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown"  data-hover="dropdown">行业应用</button>
	<ul class="dropdown-menu">
		<li><a href="https://www.csdn.net/" target="_blank">First Action</a></li>
		<li><a href="https://v3.bootcss.com/" target="_blank">Second Action</a></li>
		<li><a href="https://api.jquery.com/" target="_blank">Third Action</a></li>
	</ul>
   	</div>

<!-- 按钮4 -->
	<div class="btn-group">
		<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">公司文化
		</button>
	</div>
	</ul>

需要用到的bootstrap中Javascript的插件:

<script src="https://cdn.bootcss.com/bootstrap-hover-dropdown/2.2.1/bootstrap-hover-dropdown.js">
</script>
 类似资料: