开发者

Mouseenter Mouseleave issue

开发者 https://www.devze.com 2023-03-22 09:57 出处:网络
I have the following html <div class=\"a-class\"> <img src=\"image\" alt=\"\" /> &l开发者_StackOverflow社区t;div class=\"b-class\"></div>

I have the following html

<div class="a-class">
   <img src="image" alt="" />
   &l开发者_StackOverflow社区t;div class="b-class"></div>
</div>

I am using

jQuery('.a-class').mouseleave(function() {
     //blah blah
});

The problem is that b-class is "overlayed" ontop of a-class for part of it - so everytime I move the mouse over the overlay of b-class - it fires mouseleave

Is there any way I can ignore b-class for this ? Thought maybe:

jQuery('.a-class').not('.b-class').mouseleave(function() {
         //blah blah
    });

But that doesn't work ?


If you want to mouseover image and not the div below it.. You should target the image only and not exclude something.

jQuery('.a-class img').mouseleave(function() {
     //blah blah
});

Edit:

Right.. So, ive done something like this before.. Its actually ongoing project.

Mouseleave is the thing that actually solves this. I had similar problem with my project because i was using mouseout which kept dropping the ball.

http://jsfiddle.net/SaPcE/ here you should notice that mouseleave doesnt drop the mouseenter function But if you change mouseleave to mouseout, that will happen.

So.. you shouldnt have a problem is what im saying i guess.


Because i think you might be doing something much similar as mine and my friends project, you might want to check this out http://photoshopmesta.net/sic/theTest/

And this is the main site http://photoshopmesta.net/sic/

Sic is free to use even commercially so that shouldnt be a big show stopper. Theres currently in version ( 1.2 ) a little chrome issue with fancybox ( image viewer ) that it uses but it will be fixed.. ( We dont support ie6, so if you want that.. SIC is not the way to go. It might work in ie6.. somewhat? but we dont really know or care. )

0

精彩评论

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

关注公众号