简体   繁体   English

jQuery:如果按钮为“悬停”,则在NEXT按钮中更改样式

[英]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". 如果主按钮悬停了,我在下一个按钮中遇到了巫婆更改样式border-left-color的问题,并且如果主按钮是“ focus”,我需要相同的功能“ 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;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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