jquery - on mouseover display none previous li -


i made function using mouseover , helps me setting properties of current li element displayed none. how can make work when put mouse on li element sets css property of previous li element display:none ?

    $('.sub-men-hdr ul li').mouseover(function() {      $(this).css('display','none');      }); 

is there way can achieve css3 ? cause tried using

.sb-men li:hover:nth-child(-1).mispnhd {    display:none; } 

but know wont accept negative values.

you can use:

$('.sub-men-hdr ul li').mouseover(function() {   $(this).prev().css('display','none'); }); 

Comments

Popular posts from this blog

javascript - JS causing window size to be bigger than necessary - Dropdown bug -

php - Calling a template part from a post -

How to mention the localhost in android -