Skip to content

Instantly share code, notes, and snippets.

@artlung
Created April 6, 2010 03:30
Show Gist options
  • Save artlung/357195 to your computer and use it in GitHub Desktop.
Save artlung/357195 to your computer and use it in GitHub Desktop.
var LAAL = {
init : function() {
var that = this;
$('#MenuText ul li a').bind('mouseover', function() {
var id = '#show_' + $(this).parents('li:first').attr('id').split('_')[1];
var offset = $(this).parents('li:first').offset();
$('.subMenu').hide();
if (!$(this).parents('li:first').hasClass('noMenu')) {
that.showMenu(id, offset);
}
});
$('#MenuText ul li span').bind('click', function() {
var id = '#show_' + $(this).parents('li:first').attr('id').split('_')[1];
var offset = $(this).parents('li:first').offset();
$('.subMenu').hide();
if (!$(this).parents('li:first').hasClass('noMenu')) {
that.showMenu(id, offset);
}
});
$('.subMenu').bind('click', function() {
$(this).fadeOut();
});
},
showMenu : function (id, offset) {
$(id).css({ top: offset.top - 20,
left: (offset.left + 152)
}).fadeIn();
}
};
jQuery(document).ready(function(){
LAAL.init();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment