Skip to content

Instantly share code, notes, and snippets.

@kshoufer
Created November 27, 2012 08:28
Show Gist options
  • Save kshoufer/4153127 to your computer and use it in GitHub Desktop.
Save kshoufer/4153127 to your computer and use it in GitHub Desktop.
jQuery code to fade in a dropdown menu when hovered over.
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#nav li").has("ul").hover(function () {
$(this).addClass("current").children("ul").show().hide().fadeIn(500);
}, function () {
$(this).removeClass("current").children("ul").stop(true, true).css("display", "none");
});
});
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment