mouseenter()制作三级导航。第三级如何写,
<script>
$(function(){
//左侧菜单导航切换
$(".side_lev1 li").mouseenter(function(){
//为当前的li添加选中样式
$(this).addClass("active");
//鼠标进入对应下标的一级菜单,显示对就的二级菜单
var $enterIndex = $(this).index();
$(".side_nave").show();
//对于下标的二级菜单显示,其余隐藏
$(".side_nave .item:eq("+$enterIndex+")").show().siblings().hide();
}).mouseleave(function(){
//离开当初一级菜单取消选中样式
$(this).removeClass("active");
//鼠标离开一级菜单进入二级菜单时
$(".side_nave .item").mouseenter(function(){
//进入对应二级菜单时给相应的一级菜单添加选中样式
//$(".side_lev1 li:eq("+$(this).index()+")").addClass("active");
}).mouseleave(function(){
//离开后隐藏对应的显示内容
$(".side_nave").hide();
$(".side_lev1 li:eq("+$(this).index()+")").removeClass("active");
});
});
//changeFrameHeight();
window.onresize = function(){
changeFrameHeight();
console.log(document.getElementById('myMain').offsetHeight);
}
});
function toIndex()
{
window.location.href="/zyglxt/xads/";
}
</script>