I am having a Label and the popup panel and when the mousemove over the label the popup will show and when the mousemove out of the label the popup will hide. I have completed till this but when the popup is showing and the cursor move inside it the popup will stay.I am facing the problem that the two events are not working simultaneously.
Asked
Active
Viewed 43 times
-2
-
Can you create a fiddle with your code? it will be more helpful to understand your problem. – akshaykumar6 Apr 03 '14 at 11:23
-
label.addEventListener("mouseover",function(e) { body.appendChild(popup); { popup.addEventListener("mouseout",function(e) { body.removeChild(popup); });} });} label.addEventListener("mouseout",function(e) { body.removeChild(popup); }); – user Apr 03 '14 at 11:24
-
1Please use http://jsfiddle.net/ to write your code. – akshaykumar6 Apr 03 '14 at 11:26
-
either the label is working together or if i remove the last listener than the popup listener will work i donot know what to do – user Apr 03 '14 at 11:28
-
1Can you edit your question and add HTML and JavaScript code? – akshaykumar6 Apr 03 '14 at 11:33
-
http://jsfiddle.net/luckyyy/p3R8w/ – user Apr 03 '14 at 11:38
-
Also add HTML to HTML block in fiddle. – akshaykumar6 Apr 03 '14 at 11:40
-
actually i have written it in the jsni – user Apr 03 '14 at 11:40
-
please help if you have any idea...to how the event work correctly – user Apr 03 '14 at 11:56
-
Check it out http://jsfiddle.net/3xXM5/, it is working for me. – akshaykumar6 Apr 03 '14 at 11:58
-
thanks you...but the popup is not staying when the mouse will move over it...I also want to have that ... – user Apr 03 '14 at 12:01
-
i would like to give the example as we are having the tags title and when the mouse is over that it will show and when the mouse is out it will become hidden and when the mouse is over the popup it will be staying..i want to have that functionality.. – user Apr 03 '14 at 12:07
-
Can you use click event? It'll be much easier. – akshaykumar6 Apr 03 '14 at 12:11
-
i have to work on mouse over and mouse out...means on mouse hovering – user Apr 03 '14 at 12:17
-
Check this out http://jsfiddle.net/3xXM5/1/ , it works but you can make changes as you want. – akshaykumar6 Apr 03 '14 at 13:03
-
thanks...but using this in my code the popup is not staying,please help if you have any other solution. – user Apr 04 '14 at 05:09
-
label.addEventListener("mouseover","mouseout",function(e { alert(e.type); if(e.type=="mouseover") { alert(hello); } }); – user Apr 07 '14 at 05:09
-
I have done the showing and hiding of popup in jqery,,,but still no benefit..http://jsfiddle.net/luckyyy/sXZFt/ – user Apr 09 '14 at 10:08
1 Answers
0
var hideDelayTimer=null;
var hideDelay=100;
label.addEventListener("mouseover",function()
{
if(hideDelayTimer)clearTimeout(hideDelayTimer);
alert('mouseover');
label.appendChild(popup);
});
label.addEventListener("mouseout",function()
{
alert('mouseout');
if(hideDelayTimer)clearTimeout(hideDelayTimer);
hideDelayTimer=setTimeout(function()
{
hideDelayTimer=null;
label.removeChild(popup);
},hideDelay);

user
- 1
- 4