效果如图所示:

html代码:
jQuery代码:
//导航效果(兼容IE6)
/*
1.使用$("#navigation ul li:has(ul)")函数来选择含有- 元素的
- 元素,然后为它们添加hover事件, 2.在hover事件的第一个函数内,使用$(this).children("ul")找到
- 元素内部的
- 元素,然后用stop(true,true)语句使导航向下扩展
3.在hover事件的第二个函数内,用stop(true,true).slideUp("fast")语句使导航向上隐藏
4.在两个动画效果之前都添加了stop(true,true)方法,这样做的好处是能把为执行完的动画队列清空,并且将正在执行的动画跳转到末状态
*/
$(function(){
$("#navigation ul li:has(ul)").hover(function(){
$(this).children("ul").stop(true,true).slideDown(400);
},function(){
$(this).children("ul").stop(true,true).slideUp("fast");
});
})
更多jQuery实现的导航下拉菜单效果相关文章请关注PHP中文网!









