Is it possible to translate this code from jQuery to CSS or LESS?
$('li').mouseover(function() {
if ($('li ul li ul li:hover').length) {
$('li ul li ul li:hover').css('background', 'red');
} else if ($('li ul li:hover').length) {
$('li ul li:hover').css('background', 'red');
} else {
$('li:hover').css('background', 'red');
}
});
$('li').mouseout(function() {
$(this).css('background', 'transparent');
});
This code is used to hover the elements in a list like here: JSFIDDLE