简体   繁体   中英

CSS if an element hover than element active change

It's possible to achieve this in any way? If the btn "home" on state :active is red and visible, when I move the mouse :hover on another btn "about" it's possible to change the opacity of "home" :active and make it disappear?

add class home to the active and class about to the not active

  $(document).ready(function () {    
   $(".home").mouseover(function () {
    $(".about").addClass("active");
    $(".home").removeClass("active");
   });
   $(".about").mouseover(function () {
    $(".home").addClass("active");
    $(".about").removeClass("active");
   });
   });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM