onmouseover with javascript
问题 I would like div a and div b to switch places when the mouse is over div b then switch back when mouse leaves div a . But its super glitchy and will switch even when mouse hasn't left div a . How do i get it to not run navMouseOut when mouse is still in div a , and why is it doing this. (please test code to see whats wrong) document.getElementById("b").onmouseover = function() { navMouseOver() }; document.getElementById("a").onmouseout = function() { navMouseOut() }; function navMouseOver() {