Reputation: 964
I use jQuery mouseover to do something. But if I move mouse over about 5-7 time - it freezed.
Why this problem appears?
I tryed mouseover and hover.
Code example:
$('span.info_icon').mouseover(function() {
$('#info_box').show(600);
}).mouseout(function(){
$('#info_box').hide(600);
});
Live example: http://dev.dolina-imeniy.ru/fotogalereya/kp_usadba_tishnevo (over red "I").
Upvotes: 0
Views: 382
Reputation: 30099
First of all, you have both jQuery and inline script defined:
<span class="info_icon" onmouseout="showMess('info_box');" onmouseover="showMess('info_box');"></span>
Having both is going to cause issues. (It will show twice, hide twice, etc). This could eventually get things out of sync, but more importantly it is just plain redundant.
Also, your info_box covers the triggering span, so every time it shows, you trigger a mouseout
. This will end up toggling the info over and over.
The combination of these things will cause problems that may lead to what you are seeing. Fix these issues first.
Upvotes: 2
Reputation: 29739
The problem: #info_box
is overlapping the .info_icon
which causes the mouseout event immediately to trigger. Therefore, it would be better if you give the info icon a higher z-index
than the info box.
Upvotes: 3