YuhangYang (Talk | contribs) |
YuhangYang (Talk | contribs) |
||
Line 11: | Line 11: | ||
$(".page_title").text("部分"); | $(".page_title").text("部分"); | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
$(window).scroll(function(){ | $(window).scroll(function(){ |
Revision as of 00:59, 18 October 2018
$(function(){
$(document).attr("title","Parts - Team:SSTi-SZGD - 2018.igem.org");
$(".page_nav ul li").removeClass("active"); $(".page_nav ul li").eq(2).addClass("active");
if(window.location.search==""){ $(".page_title").text("Parts"); }else{ $(".page_title").text("部分"); }
$(window).scroll(function(){
var Hpage_nav=$(".page_nav").outerHeight()+75; var oTop_All=$(".All_parts").offset().top-Hpage_nav; var oTop_Basic=$(".Basic_part").offset().top-Hpage_nav; var oTop_Composite=$(".Composite_part").offset().top-Hpage_nav; var oTop_Improved=$(".Improved_part").offset().top-Hpage_nav; var sTop=$(window).scrollTop(); if(sTop>=oTop_Improved){ $(".sub_nav li a").removeClass("active"); $(".sub_nav li.Parts a").eq(3).addClass("active"); }else if(sTop>=oTop_Composite){ $(".sub_nav li a").removeClass("active"); $(".sub_nav li.Parts a").eq(2).addClass("active"); }else if(sTop>=oTop_Basic){ $(".sub_nav li a").removeClass("active"); $(".sub_nav li.Parts a").eq(1).addClass("active"); }else if(sTop>=oTop_All){ $(".sub_nav li a").removeClass("active"); $(".sub_nav li.Parts a").eq(0).addClass("active"); }else{ $(".sub_nav li a").removeClass("active"); }
});
});