Difference between revisions of "Template:SJTU-BioX-Shanghai/Alpha/Header"
Line 1: | Line 1: | ||
<html> | <html> | ||
+ | |||
+ | <script> | ||
+ | function hide_nav_click(this) { | ||
+ | var nav = this.parentElement | ||
+ | nav.classList.add('nav-hided') | ||
+ | this.innerHTML = '>' | ||
+ | this.onclick = "show_nav_click(this)" | ||
+ | } | ||
+ | function show_nav_click(this) { | ||
+ | var nav = this.parentElement | ||
+ | nav.classList.remove('nav-hided') | ||
+ | this.innerHTML = '<' | ||
+ | this.onclick = "hide_nav_click(this)" | ||
+ | } | ||
+ | </script> | ||
+ | |||
<style> | <style> | ||
body { | body { | ||
Line 29: | Line 45: | ||
font-family: "Tahoma, Geneva, sans-serif"; | font-family: "Tahoma, Geneva, sans-serif"; | ||
+ | } | ||
+ | nav.nav-hided { | ||
+ | display: none; | ||
} | } | ||
Line 172: | Line 191: | ||
<nav> | <nav> | ||
<div>SJTU Bio-X</div> | <div>SJTU Bio-X</div> | ||
− | <button id="hide-nav"><</button> | + | <button id="hide-nav" onclick="hide_nav_click(this)"><</button> |
<ul> | <ul> | ||
<li><a href="#">home</a></li> | <li><a href="#">home</a></li> |
Revision as of 07:35, 10 August 2015