未登录状态下的导航栏调整

dev_shixuns
cxt 6 years ago
parent 0b7593c4ec
commit b9a72287d1

@ -7,6 +7,7 @@ module SubjectsHelper
# 实训路径详情列表,右侧状态显示栏
def shixun_show_in_subject subject_status, shixun_status
content = ""
content = if subject_status < 2
case shixun_status
when 0, 1

@ -91,22 +91,19 @@
document.getElementById('nHeader').style.left=sl+'px';
}
$(function () {
<% if params[:action] == "index" %>
var $header = $("#header-nav").children("li");
<% case params[:controller] %>
<% when "welcome" %>
<% if params[:controller] == "welcome" %>
$("#header-nav").children("li").eq(0).addClass("active");
<% when "shixuns" %>
<% elsif subjects_controller.include?(params[:controller]) %>
$("#header-nav").children("li").eq(1).addClass("active");
<% when "subjects" %>
<% elsif course_controller.include?(params[:controller]) %>
$("#header-nav").children("li").eq(2).addClass("active");
<% when "courses" %>
<% elsif shixuns_controller.include?(params[:controller]) %>
$header.length == 7 ? $header.eq(2).addClass("active") : $header.eq(3).addClass("active");
<% when "competitions" %>
<% elsif params[:controller] == "competitions" %>
$header.length == 7 ? $header.eq(5).addClass("active") : $header.eq(4).addClass("active");
<% when "forums" %>
<% elsif params[:controller] == "forums" %>
$header.length == 7 ? $header.eq(6).addClass("active") : $header.eq(5).addClass("active");
<% end %>
<% end %>
})
</script>
Loading…
Cancel
Save