0

I have following jquery code, which is working fine. But if i do mouseover on multiple divs frequently. previous mouseleave doesnot work.

Can anybody tell me how to resolve this issue. Also i want to add some delay to call ajaxToolTip(bookmark_id) function. i tried setTimeout(ajaxToolTip(bookmark_id, 3000); but it doesn't make any effect.

 $(document).on({
                    mouseenter: function () {
                        /* Send Ajax Request for data */
                        bookmark_id=$(this).find('.move_icon').attr('serial');
                            $(this).addClass('hovertool_'+bookmark_id);
                            ajaxToolTip(bookmark_id);
                    },  
                    mouseleave: function () {
                    bookmark_id=$(this).find('.move_icon').attr('serial');
                    $(this).removeClass('hovertool_'+bookmark_id);
                    $('.publichoverbox_'+bookmark_id).remove();


                }
                }, '.boxespublic');

Does anybody tell me how to do this Thanks

Hitu
  • 276
  • 1
  • 2
  • 14
  • I'm guessing here... do you really mean to use `mouseenter` on `body`? And not `mouseover`. Same for `mouseout` instead of `mouseleave`? I'm not sure both your events will fire on the `document`. See http://stackoverflow.com/questions/7286532/jquery-mouseenter-vs-mouseover – Mischa Aug 19 '14 at 07:19
  • If you have mouseenter and mouseleave functions on your body. Technically your mouse will never leave, if you take the mouse of the window of your browser, the browser thinks that the mouse is still at the edge of where the mouse left the screen. Rather fire this element with divs just so both methods can be hit. For your timeout try this setInterval(function () {alert("Hello")}, 3000); you can nest that within your mouseover or mouseleave. – Jonny Aug 19 '14 at 07:29

0 Answers0