简体   繁体   English

如何在 css a:hover in jQuery 中定位锚点“悬停”事件

[英]How to target anchor 'Hover' event like in css a:hover in jQuery

I try this Style but i see a Glitch how can i make it correctly, try to hover many times to see the glitch .我尝试这种风格,但我看到了一个Glitch我怎样才能正确地做它,尝试hover多次看到glitch I dont need CSS solution thanks.我不需要CSS解决方案谢谢。 Fiddle小提琴

hover() bind two handlers to the element. hover()将两个处理程序绑定到元素。 One for mouse pointer enters and another for leaves the element.一个用于鼠标指针进入,另一个用于离开元素。 Try like following尝试如下

$('.wrap div').hover(function () {
    $(this).find('a').addClass('active');
}, function () {
    $(this).find('a').removeClass('active');
});

DEMO演示

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

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