سؤال

I have a problem in a jquery dropdown menu. In my example (link in the bottom) I want that when I hover the Submenu the color of the current menu item (item 2) stays in hover state (color white in example).

I want this in jquery/javascript and not css.

Link To Live Example with complete Code

Thanks

هل كانت مفيدة؟

المحلول

$("ul.submenu li a").css({'background-color': '#fdfa02'});
$("ul.submenu").css({'background-color': '#fdfa02'});
$("ul.submenu2").css({'background-color': '#fdfa02'});   
$('ul.submenu li a').css('color', '#00FF00');

//change the menu text color on mouse over
$('ul.menu li').hover(function () {    
     $(this).find("span:first a").css({color:'#FFFFFF'});    
},
function () {
    $(this).find("span:first a").css({color:'#000000'});  
});
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top