$(function(){ $("#menu1").on({ mouseover: function(){ $("#hovermenu1").show(); }, mouseout: function(){ $("#hovermenu1").hide(); } }); $("#hovermenu1").on({ mouseover: function(){ $(this).show(); }, mouseout: function(){ $(this).hide(); } }); $("#menu3").on({ mouseover: function(){ $("#hovermenu3").show(); }, mouseout: function(){ $("#hovermenu3").hide(); } }); $("#hovermenu3").on({ mouseover: function(){ $(this).show(); }, mouseout: function(){ $(this).hide(); } }); });