我想默认显示一个新贴纸,但它的定位方式是在悬停菜单时,子导航应该替换新贴纸。但我不能完全让它工作:
JSFiddle:http: //jsfiddle.net/rd9jS/
$(document).ready(function() {
$('#nav > ul > li').mouseover(function () {
$('#news').hide();
$(this).parent().find("ul.children").not($('ul.children', this)).hide();
$('ul.children', this).slideDown();
});
$('#nav .children').mouseleave(function (e) {
setTimeout(function(){
$(this).hide();
$('#news').slideDown();
},2000);
e.stopPropagation();
});
});