开发者

Weird behaviour hover event jQuery

开发者 https://www.devze.com 2023-02-26 06:27 出处:网络
I have the following code on some absolute positioned divs on a page: JS/JQUERY: $("div.do").hover(functi开发者_StackOverflow中文版on(){

I have the following code on some absolute positioned divs on a page:

JS/JQUERY:

$("div.do").hover(functi开发者_StackOverflow中文版on(){          
$(this).stop().next('.tooltip').fadeIn();    
}, function(){
 $(this).stop().next('.tooltip').fadeOut();     
});   

HTML:

<div class="do"></div>
<div class="do"></div>
<div class="do"></div> 

When hovering over an event using console.log($(this)) returns multiple events firing in a very sporadic way. it seems like they are being trigger multiple times. I have been using jQuery for quite some time and never experienced anything like this.

Any insight is greatly appreciated.


works like a charm for me > http://jsfiddle.net/ekxxC/


Here's a fiddle of almost the same thing you posted. It's working exactly as I would imagine. See if your code is any different:

http://jsfiddle.net/eyLNn/4/

I highlighted the divs in red so you can see where the target area is.

0

精彩评论

暂无评论...
验证码 换一张
取 消