sameer.entrout Posted April 28, 2016 Share Posted April 28, 2016 (edited) if(trigger.getAttribute("onmouseover")) { document.addEventListener("mouseover", function(event) { if(event.target !== elem && event.target !== elem.parentNode) { if(elem.style.opacity == 1) fadeOut(x); } }, false) } The code above is not working properly as it is supposed to. I have a trigger element which is event.currentTarget. When the user hovers over the trigger item the elem is display. What I am looking for is that when the user hover over anything else on the page except the trigger and the elem items the elem should fade out. The code works fine when I use onmouseenter event; however, that is not supported in safari and some older versions of other browsers as well. Therefore, please help with this I have been stuck at this problem for days now and there is no good online resource for it as well. Thanks! in advance... Sam Edited April 28, 2016 by sameer.entrout Link to comment Share on other sites More sharing options...
davej Posted May 2, 2016 Share Posted May 2, 2016 Can you provide a small example that includes the HTML? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now