Unbroke JS

This commit is contained in:
Phil Howard 2016-01-30 22:14:51 +00:00
parent c1aa262288
commit e5ebb125a3
1 changed files with 15 additions and 5 deletions

View File

@ -9,10 +9,19 @@ jQuery(document).ready(function(){
$('#container').on('click',function(){
dropdowns.slideUp(100);
})
});
$('#sections > ul > li').hover(function(){
var dropdown = $(this).find('div');
$('#sections > ul > li > a').click(function(e){
e.preventDefault();
e.stopPropagation();
var dropdown = $(this).parent().find('div');
dropdowns.hide();
dropdown.show();
});
$('#sections > ul > li > a').hover(function(e){
e.preventDefault();
var dropdown = $(this).parent().find('div');
clearTimeout(overlay_slideUp);
if(dropdowns.filter(':visible').length){
dropdowns.hide();
@ -22,8 +31,9 @@ jQuery(document).ready(function(){
{
overlay_slideUp = setTimeout(function(){dropdowns.slideUp(100);dropdown.slideDown(100);}, 300);
}
},function(){
var dropdown = $(this).find('div');
},function(e){
e.preventDefault();
var dropdown = $(this).parent().find('div');
clearTimeout(overlay_slideUp);
overlay_slideUp = setTimeout(function(){dropdown.slideUp(100);}, 500);
});