Created
May 21, 2014 00:23
-
-
Save sunilw/a328cd885bb106d210c2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
jQuery(document).ready(function() { | |
var mobileNavMenu = $("#mobile-nav-menu"); | |
var mobileNavButton = $(".mobile-nav-button") ; | |
var uberMenu = $("#ubermenu") ; | |
(function(){ | |
window.larkinApp = { | |
data : { | |
mobileNavVisible : 'false', | |
uberdropVisible : 'false' | |
}, // ends data | |
functions : { | |
toggleNav : function() { | |
console.debug("got to toggleNav") ; | |
if ( window.larkinApp.data.mobileNavVisible == 'false' ) { | |
mobileNavMenu.slideDown(); | |
window.larkinApp.data.mobileNavVisible = 'true' ; | |
} else { | |
mobileNavMenu.slideUp(); | |
window.larkinApp.data.mobileNavVisible = 'false' ; | |
} | |
}, // ends toggleNav | |
uberMenuShowHide : function(){ | |
console.debug("got to showhide"); | |
if (window.larkinApp.data.uberdropVisible = 'false' ) { | |
uberMenu.fadeIn(); | |
window.larkinApp.data.uberdropVisible = 'false'; | |
} | |
else { | |
uberMenu.fadeOut(); | |
window.larkinApp.data.uberdropVisible = 'true'; | |
} | |
console.debug("uberMenuShowHide is done") ; | |
} // ends findDropDownTrigger | |
}, //ends functions | |
init : { | |
tests : function() { | |
console.debug("got to test") ; | |
}, // ends tests | |
uberMenu: function() { | |
console.debug("got to uberMenu") ; | |
var trigger = $(".header-nav .page-item-4") ; | |
trigger.on("mouseover", function(e) { | |
e.preventDefault() ; | |
window.larkinApp.functions.uberMenuShowHide(); | |
}); | |
uberMenu.on("mouseleave", function() { | |
console.debug("leaving!"); | |
uberMenu.fadeOut(); | |
}); | |
} // ends uberMenu | |
} // ends init | |
}; | |
window.larkinApp.init.tests() ; | |
window.larkinApp.init.uberMenu() ; | |
})(); // ends our iife | |
mobileNavButton.on("click", function() { | |
larkinApp.functions.toggleNav(); | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment