组织门户导航栏二级显隐

This commit is contained in:
Tim 2016-05-06 10:02:31 +08:00
parent 6057ea15e1
commit 4bf1883ba2
4 changed files with 33 additions and 19 deletions

View File

@ -34,6 +34,18 @@
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
scrollPic(); scrollPic();
$(".nav-element").mouseover(function(){
$(this).next().show();
});
$(".sn-grey-opacity").mouseover(function(){
$(this).show();
});
$(".nav-element").mouseout(function(){
$(this).next().hide();
});
$(".sn-grey-opacity").mouseout(function(){
$(this).hide();
});
}); });
function scrollPic() { function scrollPic() {
var scrollPic = new ScrollPic(); var scrollPic = new ScrollPic();
@ -50,7 +62,7 @@
scrollPic.autoPlayTime = 3; //自动播放间隔时间(秒) scrollPic.autoPlayTime = 3; //自动播放间隔时间(秒)
scrollPic.initialize(); //初始化 scrollPic.initialize(); //初始化
} };
</script> </script>
</head> </head>
@ -104,15 +116,15 @@
<% if is_default_field?(field) %> <% if is_default_field?(field) %>
<% case field.name %> <% case field.name %>
<% when 'activity' %> <% when 'activity' %>
<li class="nav-element"> <li class="nav-element-default">
<%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %> <%= link_to "首页", organization_path(@organization), :class => "sn-link-white" %>
</li> </li>
<% when 'course' %> <% when 'course' %>
<li class="nav-element"> <li class="nav-element-default">
<a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a> <a href="#course_<%= field.id %>" class="sn-link-white"> 课程动态</a>
</li> </li>
<% when 'project' %> <% when 'project' %>
<li class="nav-element"> <li class="nav-element-default">
<a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a> <a href="#project_<%= field.id %>" class="sn-link-white">项目动态</a>
</li> </li>
<% end %> <% end %>
@ -125,7 +137,7 @@
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;"> <div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;"> <ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %> <% field.sub_domains.each do |subdomain| %>
<li><a href="javascript:void(0);" class="sn-link-grey"><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id) %></a></li> <li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => field.id), :class => "sn-link-grey" %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>

View File

@ -119,7 +119,7 @@
<div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;"> <div class="sn-row sn-subnav-position sn-grey-opacity" style="display:none;">
<ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;"> <ul class="sn-sub-nav" style="display:<%= if_hidden_subdomain( field) ? 'block':'none' %>;">
<% field.sub_domains.each do |subdomain| %> <% field.sub_domains.each do |subdomain| %>
<li><a href="javascript:void(0);" class="sn-link-grey"><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => @org_subfield.id) %></a></li> <li><%=link_to subdomain.name, org_subfield_sub_domain_sub_document_comments_path(subdomain, :org_subfield_id => @org_subfield.id), :class => "sn-link-grey" %></li>
<% end %> <% end %>
</ul> </ul>
</div> </div>

View File

@ -120,20 +120,22 @@
<% end %> <% end %>
<% else %> <% else %>
<% if !field.subfield_subdomain_dir.nil? %> <div class="homepageLeftMenuBlock">
<% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %> <% if !field.subfield_subdomain_dir.nil? %>
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> <% if !request.local? and Secdomain.where("sub_type=2 and pid=?", organization.id).count > 0 and Secdomain.where("sub_type=2 and pid=?", organization.id).map(&:subname).include?(request.subdomain) %>
<%= link_to "#{field.name}", show_subfield_without_id_path(:sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %>
<% end %>
<% else %> <% else %>
<%= link_to "#{field.name}", show_org_subfield_organization_path(:id => organization.id, :sub_dir_name => field.subfield_subdomain_dir.name), :class => "homepageMenuText" %> <%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %>
<% end %> <% end %>
<% else %> <% if User.current.member_of_org?organization %>
<%= link_to "#{field.name}", org_subfield_files_path(field), :class => "homepageMenuText" %> <%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %>
<% end %> <!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>-->
<% if User.current.member_of_org?organization %> <% end %>
<%= link_to "", subfield_upload_file_org_subfield_files_path(field.id, :in_org => 1),:method => "post", :remote => true, :class => "homepageMenuSetting fr", :title => "上传资源" %> <!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
<!--<a class="homepageMenuSetting fr" title="上传资源" href="javascript:void(0);" onclick="org_subfield_files_upload(<%#= field.id %>);"> </a>--> </div>
<% end %>
<!--<a href="javascript:void(0);" class="homepageMenuText"><%#= field.name %></a>-->
<% end %> <% end %>
</div> </div>
<div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;"> <div class="homepageLeftMenuCourses" id="homepageLeftMenuField_<%= field.id %>" style="display:none;">

View File

@ -69,7 +69,7 @@ a.sn-search-button {width:53px; height:40px; border:1px solid #ccc; border-left:
.nav-element-default, .nav-element {float:left; padding-top:11px; padding-bottom:12px; margin-right:50px;} .nav-element-default, .nav-element {float:left; padding-top:11px; padding-bottom:12px; margin-right:50px;}
.nav-element-default a, .nav-element a {display:inline-block; padding:8px 6px; border-radius:5px;} .nav-element-default a, .nav-element a {display:inline-block; padding:8px 6px; border-radius:5px;}
.nav-element-default a:hover, .nav-element a:hover {background-color:#809df9;} .nav-element-default a:hover, .nav-element a:hover {background-color:#809df9;}
.sn-subnav-position {position:fixed; left:0; top:199px; z-index:99;} .sn-subnav-position {position:fixed; left:0; top:203px; z-index:99;}
.sn-sub-nav {width:1200px; margin:0 auto; font-size:14px; position:relative; line-height:1;} .sn-sub-nav {width:1200px; margin:0 auto; font-size:14px; position:relative; line-height:1;}
.sn-sub-nav li {color:#999; float:left;} .sn-sub-nav li {color:#999; float:left;}
.sn-sub-nav li a {height:40px; line-height:40px; vertical-align:middle; margin:0 5px; padding:0 5px; display:inline-block;} .sn-sub-nav li a {height:40px; line-height:40px; vertical-align:middle; margin:0 5px; padding:0 5px; display:inline-block;}