Tommyrpg1010 (Talk | contribs) |
Tommyrpg1010 (Talk | contribs) |
||
Line 267: | Line 267: | ||
} | } | ||
− | .side-button. | + | .side-button.Introduction::before { |
− | content: " | + | content: "Introduction"; |
} | } | ||
− | .side-button. | + | .side-button.Introduction:after { |
− | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/ | + | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/Socialmedia_icons_Facebook-128.png") no-repeat center; |
} | } | ||
− | .side-button. | + | .side-button.Design::before { |
− | content: " | + | content: "Design"; |
} | } | ||
− | .side-button. | + | .side-button.Design:after { |
− | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/ | + | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/Socialmedia_icons_Facebook-128.png") no-repeat center; |
} | } | ||
− | .side-button. | + | .side-button.Biosafety::before { |
− | content: " | + | content: "Biosafety"; |
} | } | ||
− | .side-button. | + | .side-button.Biosafety:after { |
− | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/ | + | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/Socialmedia_icons_Facebook-128.png") no-repeat center; |
} | } | ||
− | .side-button. | + | .side-button.Future_Application::before { |
− | content: " | + | content: "Future Applicationk"; |
} | } | ||
− | .side-button. | + | .side-button.Future_Application:after { |
− | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/ | + | background: url("https://cdn3.iconfinder.com/data/icons/social-media-2026/60/Socialmedia_icons_Facebook-128.png") no-repeat center; |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
} | } | ||
</style> | </style> | ||
Line 336: | Line 328: | ||
</div> | </div> | ||
<div class="side-container middle"> | <div class="side-container middle"> | ||
− | <div class="rela-block side-button " id="mySide_1"></div> | + | <div class="rela-block side-button" id="mySide_1"></div> |
− | <div class="rela-block side-button " id="mySide_2"></div> | + | <div class="rela-block side-button" id="mySide_2"></div> |
− | <div class="rela-block side-button | + | <div class="rela-block side-button" id="mySide_3"></div> |
− | <div class="rela-block side-button | + | <div class="rela-block side-button" id="mySide_4"></div> |
</div> | </div> | ||
</div> | </div> | ||
Line 346: | Line 338: | ||
<script> | <script> | ||
function onAnchorChange() { | function onAnchorChange() { | ||
+ | //Initialize all side element | ||
var side = [document.getElementById("mySide_1"), document.getElementById("mySide_2"), document.getElementById("mySide_3"), document.getElementById("mySide_4")]; | var side = [document.getElementById("mySide_1"), document.getElementById("mySide_2"), document.getElementById("mySide_3"), document.getElementById("mySide_4")]; | ||
− | side[ | + | |
− | side[0].classList.add(" | + | // Clear all class |
− | + | for (let i = 0; i < 4; i++) { | |
+ | side[i].classList.remove(side[i].classList.item(2)); | ||
+ | } | ||
+ | |||
+ | // Get anchor url var currentUrl = document.URL, | ||
+ | var urlParts = document.URL.split('#'); | ||
+ | if urlParts.length > 1 { | ||
+ | var anchor = urlParts[1]; | ||
+ | |||
+ | // Add the corresponding class | ||
+ | switch (anchor) { | ||
+ | case "0": | ||
+ | case "1": | ||
+ | side[0].classList.add("Introduction"); | ||
+ | side[1].classList.add("Design"); | ||
+ | side[2].classList.add("Biosafety"); | ||
+ | side[3].classList.add("Future_Application"); | ||
+ | break; | ||
+ | case "2": | ||
+ | case "3": | ||
+ | case "4": | ||
+ | case "5": | ||
+ | } | ||
+ | |||
+ | } | ||
} | } | ||
Revision as of 05:00, 10 October 2018
Interactive Cell
Human Practices
Human Practices