I am trying to play with jQuery
mouseenter
and mouseleave
events but failing.
Here is what I am trying to do
$("#selector").mouseenter(function(){
some code....
jQuery(this).off('mouseenter');
}
);
$("#selector").mouseleave(function(){
some code....
jQuery(this).on('mouseenter');
});
In this .off()
is working but unfortunately .on
is not working.
Can anyone help me here?
Thx in advance.
>
Edit: Sorry for less information in my above question.
I need to open tooltip on mouseenter
and have some buttons in that tooltip. This tooltip is appended in same div. So when I try to click on button in the tooltip it calls mouseenter
event and so tooltip is appended again in the div.
So I am calling .off()
event once tooptip is called till mouse doesn't leave selector.
Let me know if you need more information.
Thx again.