Difference between revisions of "Template:SJTU-BioX-Shanghai/Alpha/Header"

Line 7: Line 7:
 
   var nav = btn.parentNode;
 
   var nav = btn.parentNode;
 
   var svg = btn.firstChild;
 
   var svg = btn.firstChild;
  svg.setNamedItem("transform", "matrix(1,0,0,-1,0,5)")
 
 
   nav.classList.add('nav-hided')
 
   nav.classList.add('nav-hided')
}
+
   console.log(svg)
function show_nav_click(btn) {
+
   alert('show')
+
  btn.onclick = "hide_nav_click(this)"
+
  var nav = btn.parentNode;
+
  var svg = btn.firstChild;
+
  svg.removeNamedItem("transform")
+
  nav.classList.remove('nav-hided')
+
 
}
 
}
 
</script>
 
</script>
Line 213: Line 205:
 
     <nav>
 
     <nav>
 
       <div>SJTU Bio-X</div>
 
       <div>SJTU Bio-X</div>
       <div id="hide-nav" onclick="hide_nav_click(this)"><svg width="10px" height="40px"><polygon points="10,0 0,20 10,40"/></svg></div>
+
       <div id="hide-nav" onclick="hide_nav_click(this)"><svg transform="matrix(1,0,0,-1,0,10)" width="10px" height="40px"><polygon points="10,0 0,20 10,40"/></svg></div>
 
       <ul>
 
       <ul>
 
<li><a href="#">home</a></li>
 
<li><a href="#">home</a></li>

Revision as of 01:18, 11 August 2015