随鼠标移动tab
<script language="javascript">
function tabChange(obj, id) {
var arrayli = obj.parentNode.getElementsByTagName("li"); //获取li数组
var arrayul = document.getElementById(id).getElementsByTagName("ul"); //获取ul数组
for (i = 0; i < arrayul.length; i++) {
if (obj == arrayli[i]) {
arrayli[i].className = "cli";
arrayul[i].className = "";
}
else {
arrayli[i].className = "";
arrayul[i].className = "hidden";
}
}
}
</script>
<div class="tabmenu_lz">
<ul>
<li onmouseover="tabChange(this,'tabcontent')" class="cli">头条</li>
<li onmouseover="tabChange(this,'tabcontent')">动态</li>
<li onmouseover="tabChange(this,'tabcontent')">讲座</li>
<li onmouseover="tabChange(this,'tabcontent')">资料</li>
</ul>
</div>
<div id="tabcontent" class="hp_lz">
<ul name="tabul">
<!--ul不能少, 里面的li可以少-->
@Html.Action("IndexTt")
</ul>
<ul class="hidden">
<!--ul不能少, 里面的li可以少-->
@Html.Action("IndexDt")
</ul>
<ul class="hidden">
<!--ul不能少, 里面的li可以少-->
@Html.Action("IndexJz")
</ul>
<ul class="hidden">
<!--ul不能少, 里面的li可以少-->
@Html.Action("IndexZl")
</ul>
</div>