function addSlipMenu () { var loggedas = $('#current_user_li a:first'); var sub_menu = $('#user_sub_menu'); loggedas.mouseenter(function() { sub_menu.show(); $('#my_projects_ul').hide(); $('#my_courses_ul').hide(); }); sub_menu.mouseleave(function() { sub_menu.hide(); $('#my_projects_ul').hide(); $('#my_courses_ul').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() { course_sub_menu.hide(); project_sub_menu.show(); }); loggedas.mouseleave(function() { project_sub_menu.hide(); course_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() { project_sub_menu.hide(); course_sub_menu.show(); }); loggedas.mouseleave(function() { course_sub_menu.hide(); project_sub_menu.hide(); }); } $(document).ready(function () { addSlipMenu(); addProjectSlipMenu (); addCourseSlipMenu(); }); //消息提醒 function MessageAddSlipMenu () { var loggedas = $('#current_message_li a:first'); var sub_menu = $('#message_sub_menu'); loggedas.mouseenter(function() { sub_menu.show(); $('#my_projects_message_ul').hide(); $('#my_courses_message_ul').hide(); }); sub_menu.mouseleave(function() { sub_menu.hide(); $('#my_projects_message_ul').hide(); $('#my_courses_message_ul').hide(); }); } function MessageAddProjectSlipMenu () { var loggedas = $('#my_projects_message_li'); var project_sub_menu = $('#my_projects_message_ul'); var course_sub_menu = $('#my_courses_message_ul'); loggedas.mouseenter(function() { course_sub_menu.hide(); project_sub_menu.show(); }); loggedas.mouseleave(function() { project_sub_menu.hide(); course_sub_menu.hide(); }); } function MessageAddCourseSlipMenu () { var loggedas = $('#my_courses_message_li'); var project_sub_menu = $('#my_projects_message_ul'); var course_sub_menu = $('#my_courses_message_ul'); loggedas.mouseenter(function() { project_sub_menu.hide(); course_sub_menu.show(); }); loggedas.mouseleave(function() { course_sub_menu.hide(); project_sub_menu.hide(); }); } $(document).ready(function () { MessageAddSlipMenu(); MessageAddProjectSlipMenu (); MessageAddCourseSlipMenu(); }); //将右侧的最小高度设置成左侧高度,美化界面 $(document).ready(function () { $("#RSide").css("min-height",$("#LSide").height()-30); });