0
大家好 我已经创建了一个基于jquery的多级菜单,当onMouse每个subnav直接出现在悬停/点击列表项下方时。现在我遇到的问题是所选的父项目的bg颜色没有像Subnav bg一样改变。奇怪的是它在IE中工作而不是FF。这是我写的jquery脚本。jquery多级菜单
演示 - http://jsfiddle.net/pixelfx/xRVVv/4/
$(document).ready(function() {
$("ul#topnav li").hover(function() { //Hover over event on list item
$(this).css({ 'background' : '#1376c9 url(topnav_active.gif) repeat-x'});
$("ul#topnav li.active1").css({ 'background' : 'CCFFCC'});
$(this).find("span").show(); //Show the subnav
} , function() { //on hover out...
$(this).css({ 'background' : 'none'});
$(this).find("span").hide(); //Hide the subnav
$(this).find("span.active").show(); //Hide the subnav
$(this).find("li.active1").show(); //Hide the subnav
$("li.active1").css({ 'background' : '1376c9'});
});});
:(我看到它改正了我的颜色,但不是动作,我用小提琴更新了文章 – clairesuzy 2011-03-29 14:46:04