简体   繁体   中英

jQuery: If button is “hover”, change style in NEXT button

I have problem witch change style border-left-color in next button, if main button is hover, and I need same function for "focus" => if main button is "focus".

Thanks for help

$("button").hover(
    function () {
        $(this).nex("button").css("border-left-color", "#6e6e6e");
    }, 
    function () {
        $(this).nex("button").css("border-left-color", "#bdbdbd");
    }
);

仅使用CSS:

button:hover + button {border-left-color: #6e6e6e;}

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