(更新导航栏) |
m (解决路径问题。) |
||
Line 7: | Line 7: | ||
{ | { | ||
"name": "Description", | "name": "Description", | ||
− | "link": "Description.html" | + | "link": "Team:DLUT_China_B/Description.html" |
}, | }, | ||
{ | { | ||
"name": "Design", | "name": "Design", | ||
− | "link": "Design.html" | + | "link": "Team:DLUT_China_B/Design.html" |
}, | }, | ||
{ | { | ||
"name": "Demonstrate", | "name": "Demonstrate", | ||
− | "link": "Demonstrate.html" | + | "link": "Team:DLUT_China_B/Demonstrate.html" |
}, | }, | ||
{ | { | ||
"name": "Experiments", | "name": "Experiments", | ||
− | "link": "Experiments.html" | + | "link": "Team:DLUT_China_B/Experiments.html" |
}, | }, | ||
{ | { | ||
"name": "InterLab", | "name": "InterLab", | ||
− | "link": "InterLab.html" | + | "link": "Team:DLUT_China_B/InterLab.html" |
}, | }, | ||
{ | { | ||
"name": "Notebook", | "name": "Notebook", | ||
− | "link": "Notebook.html" | + | "link": "Team:DLUT_China_B/Notebook.html" |
} | } | ||
] | ] | ||
Line 36: | Line 36: | ||
{ | { | ||
"name": "Parts Overview", | "name": "Parts Overview", | ||
− | "link": "PartsOverview.html" | + | "link": "Team:DLUT_China_B/PartsOverview.html" |
}, | }, | ||
{ | { | ||
"name": "Basic Parts", | "name": "Basic Parts", | ||
− | "link": "BasicParts.html" | + | "link": "Team:DLUT_China_B/BasicParts.html" |
}, | }, | ||
{ | { | ||
"name": "Composite Parts", | "name": "Composite Parts", | ||
− | "link": "CompositeParts.html" | + | "link": "Team:DLUT_China_B/CompositeParts.html" |
} | } | ||
] | ] | ||
Line 53: | Line 53: | ||
{ | { | ||
"name": "Condition Optimization", | "name": "Condition Optimization", | ||
− | "link": "ConditionOptimization.html" | + | "link": "Team:DLUT_China_B/ConditionOptimization.html" |
}, | }, | ||
{ | { | ||
"name": "Standard Curve", | "name": "Standard Curve", | ||
− | "link": "StandardCurve.html" | + | "link": "Team:DLUT_China_B/StandardCurve.html" |
}, | }, | ||
{ | { | ||
"name": "Result", | "name": "Result", | ||
− | "link": "Result.html" | + | "link": "Team:DLUT_China_B/Result.html" |
} | } | ||
] | ] | ||
Line 70: | Line 70: | ||
{ | { | ||
"name": "Applied Design", | "name": "Applied Design", | ||
− | "link": "AppliedDesign.html" | + | "link": "Team:DLUT_China_B/AppliedDesign.html" |
}, | }, | ||
{ | { | ||
"name": "Hardware", | "name": "Hardware", | ||
− | "link": "Hardware.html" | + | "link": "Team:DLUT_China_B/Hardware.html" |
}, | }, | ||
{ | { | ||
"name": "Software", | "name": "Software", | ||
− | "link": "Software.html" | + | "link": "Team:DLUT_China_B/Software.html" |
} | } | ||
] | ] | ||
Line 87: | Line 87: | ||
{ | { | ||
"name": "Human Practice", | "name": "Human Practice", | ||
− | "link": "HumanPractice.html" | + | "link": "Team:DLUT_China_B/HumanPractice.html" |
}, | }, | ||
{ | { | ||
"name": "Education", | "name": "Education", | ||
− | "link": "Education.html" | + | "link": "Team:DLUT_China_B/Education.html" |
} | } | ||
] | ] | ||
Line 100: | Line 100: | ||
{ | { | ||
"name": "Team Members", | "name": "Team Members", | ||
− | "link": "TeamMembers.html" | + | "link": "Team:DLUT_China_B/TeamMembers.html" |
}, | }, | ||
{ | { | ||
"name": "Attributions", | "name": "Attributions", | ||
− | "link": "Attributions.html" | + | "link": "Team:DLUT_China_B/Attributions.html" |
}, | }, | ||
{ | { | ||
"name": "Collaboration", | "name": "Collaboration", | ||
− | "link": "Collaboration.html" | + | "link": "Team:DLUT_China_B/Collaboration.html" |
} | } | ||
] | ] |
Revision as of 13:18, 18 September 2018
/*导航栏*/ let nav = document.getElementById("nav"); let navData = [
{ "menu": "Project", "subMenu": [ { "name": "Description", "link": "Team:DLUT_China_B/Description.html" }, { "name": "Design", "link": "Team:DLUT_China_B/Design.html" }, { "name": "Demonstrate", "link": "Team:DLUT_China_B/Demonstrate.html" }, { "name": "Experiments", "link": "Team:DLUT_China_B/Experiments.html" }, { "name": "InterLab", "link": "Team:DLUT_China_B/InterLab.html" }, { "name": "Notebook", "link": "Team:DLUT_China_B/Notebook.html" } ] }, { "menu": "Parts", "subMenu": [ { "name": "Parts Overview", "link": "Team:DLUT_China_B/PartsOverview.html" }, { "name": "Basic Parts", "link": "Team:DLUT_China_B/BasicParts.html" }, { "name": "Composite Parts", "link": "Team:DLUT_China_B/CompositeParts.html" } ] }, { "menu": "Model", "subMenu": [ { "name": "Condition Optimization", "link": "Team:DLUT_China_B/ConditionOptimization.html" }, { "name": "Standard Curve", "link": "Team:DLUT_China_B/StandardCurve.html" }, { "name": "Result", "link": "Team:DLUT_China_B/Result.html" } ] }, { "menu": "Awards", "subMenu": [ { "name": "Applied Design", "link": "Team:DLUT_China_B/AppliedDesign.html" }, { "name": "Hardware", "link": "Team:DLUT_China_B/Hardware.html" }, { "name": "Software", "link": "Team:DLUT_China_B/Software.html" } ] }, { "menu": "Human Practice", "subMenu": [ { "name": "Human Practice", "link": "Team:DLUT_China_B/HumanPractice.html" }, { "name": "Education", "link": "Team:DLUT_China_B/Education.html" } ] }, { "menu": "Team", "subMenu": [ { "name": "Team Members", "link": "Team:DLUT_China_B/TeamMembers.html" }, { "name": "Attributions", "link": "Team:DLUT_China_B/Attributions.html" }, { "name": "Collaboration", "link": "Team:DLUT_China_B/Collaboration.html" } ] }
]; let ul = document.createElement("ul"); ul.setAttribute("class", "menu"); for (let i = 0; i < navData.length; ++i) {
let menu = document.createElement("li"); let menuName = document.createElement("a"); menuName.innerText = navData[i]["menu"]; let subMenu = document.createElement("ul"); subMenu.setAttribute("class", "subMenu"); for (let j = 0; j < navData[i]["subMenu"].length; ++j) { let subMenuName = document.createElement("li"); let subMenuNameA = document.createElement("a"); subMenuNameA.innerText = navData[i]["subMenu"][j]["name"]; subMenuNameA.setAttribute("href", navData[i]["subMenu"][j]["link"]); subMenuName.appendChild(subMenuNameA); subMenu.appendChild(subMenuName); } menu.appendChild(menuName); menu.appendChild(subMenu); ul.appendChild(menu);
} document.getElementById('nav').appendChild(ul);
/*至顶按钮*/ $('#back').click(function () {
$('html').animate( {scrollTop: 0}, 500);
}); document.onscroll=function () {
if($('html').scrollTop()>600) document.getElementById("back").style.display="block"; else document.getElementById("back").style.display="none";
};