Skip to content

Instantly share code, notes, and snippets.

@mikeymicrophone
Created April 19, 2009 18:54
Show Gist options
  • Select an option

  • Save mikeymicrophone/98171 to your computer and use it in GitHub Desktop.

Select an option

Save mikeymicrophone/98171 to your computer and use it in GitHub Desktop.
var in_subnav = false;
function nap (m) {var then = new Date(new Date().getTime() + m); while (new Date() < then) {}}
$(document).ready(function() {
$('#navigation .baseball').mouseenter( function() {
$('#baseball-regions').attr('style', 'left:50px;');
});
$('#baseball-regions a:contains(\'Northeast\')').mouseenter( function() {
$('#northeast-areas').attr('style', 'left:100px;');
$('#southeast-areas').attr('style', 'left:-500px;');
});
$('#baseball-regions a:contains(\'Southeast\')').mouseenter( function() {
$('#southeast-areas').attr('style', 'left:100px;');
$('#northeast-areas').attr('style', 'left:-500px;');
});
$('#northeast-areas').mouseenter( function() {
in_subnav = true;
});
$('#southeast-areas').mouseenter( function() {
in_subnav = true;
});
$('#northeast-areas').mouseleave( function() {
$('#northeast-areas').attr('style', 'left:-500px;');
$('#baseball-regions').attr('style', 'left:-500px;');
in_subnav = false;
});
$('#southeast-areas').mouseleave( function() {
$('#southeast-areas').attr('style', 'left:-500px;');
$('#baseball-regions').attr('style', 'left:-500px;');
in_subnav = false;
});
$('#baseball-regions').mouseleave( function() {
nap(1000);
alert(in_subnav);
if (in_subnav) {
return true;
} else {
$('#northeast-areas').attr('style', 'left:-500px;');
$('#southeast-areas').attr('style', 'left:-500px;');
$('#baseball-regions').attr('style', 'left:-500px;');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment