Created
October 14, 2012 15:45
-
-
Save cxytomo/3888970 to your computer and use it in GitHub Desktop.
dropdown(including mouseout)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.getElementsByClassName('open')[0].addEventListener('mouseover',function(e) { | |
var el,show; | |
e = e || window.event; | |
e.cancelBubble = true; | |
if (e.stopPropagation) e.stopPropagation(); | |
el = document.getElementsByClassName('open')[0]; | |
show = el.getElementsByClassName('dropdown-menu')[0]; | |
show.style.display = "block"; | |
},false); | |
var hide = function(e) { | |
var el,hide; | |
e = e || window.event; | |
e.cancelBubble = true; | |
if (e.stopPropagation) e.stopPropagation(); | |
el = document.getElementsByClassName('open')[0]; | |
hide = el.getElementsByClassName('dropdown-menu')[0]; | |
hide.style.display = "none"; | |
} | |
document.getElementsByClassName('open')[0].addEventListener('mouseout',hide,false); | |
document.getElementsByClassName('open')[0].getElementsByClassName('dropdown-menu')[0].addEventListener('mouseout',hide,false); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment