我需要左侧的导航标签在悬停时向下滑动其内容。但是代码不起作用。可能是什么问题。
<ul class="nav nav-tabs nav-stacked">
<li id = "mousehover">
<a style="background-color:#f78144; color: #000; text-align: center;" href="#">Time Table</a>
</li>
</ul>
<div id = "hovercontent">
Contents 1
</div>
<script type = "script/javascript">
$(document).ready(function(){
$("#mousehover").hover(function(){
$("#hovercontent").slideDown("slow");
});
});
</script>
答案 0 :(得分:3)
替换
<script type="script/javascript">
与
<script type="text/javascript">
或只是使用
<script>
答案 1 :(得分:0)
<script type = "text/javascript">
$(document).ready(function(){
$("#mousehover").hover(function(){
$("#hovercontent").slideDown("slow");
});
});
</script>
用text / javascript替换脚本/ javascript