function addSlipMenu () { var loggedas = $('#current_user_li:first'); var sub_menu = $('#user_sub_menu'); loggedas.mouseenter(function(event) { sub_menu.show(); }); sub_menu.mouseleave(function(event) { sub_menu.hide(); }); } function addProjectSlipMenu () { var loggedas = $('#my_projects_li'); var project_sub_menu = $('#my_projects_ul'); var course_sub_menu = $('#my_courses_ul'); loggedas.mouseenter(function(event) { course_sub_menu.hide(); project_sub_menu.show(); }); loggedas.mouseleave(function(event) { project_sub_menu.hide(); }); } function addCourseSlipMenu () { var loggedas = $('#my_courses_li'); var project_sub_menu = $('#my_projects_ul'); var course_sub_menu = $('#my_courses_ul'); loggedas.mouseenter(function(event) { project_sub_menu.hide(); course_sub_menu.show(); }); loggedas.mouseleave(function(event) { course_sub_menu.hide(); }); } $(document).ready(function () { addSlipMenu(); addProjectSlipMenu (); addCourseSlipMenu(); }); //将右侧的最小高度设置成左侧高度,美化界面 $(document).ready(function () { $("#RSide").css("min-height",$("#LSide").height()-30); });