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

Line 4: Line 4:
 
alert('x');
 
alert('x');
 
function hide_nav_click(btn) {
 
function hide_nav_click(btn) {
 +
  alert('hide')
 +
  btn.onclick = "show_nav_click(this)"
 
   var nav = btn.parentNode;
 
   var nav = btn.parentNode;
   alert('hide');
+
  var svg = btn.firstChild;
 +
  console.log(svg)
 +
  nav.classList.add('nav-hided')
 +
}
 +
function show_nav_click(btn) {
 +
   alert('show')
 +
  btn.onclick = "hide_nav_click(this)"
 +
  var nav = btn.parentNode;
 +
  var svg = btn.firstChild;
 +
  console.log(svg)
 +
  nav.classList.remove('nav-hided')
 
}
 
}
 
</script>
 
</script>

Revision as of 01:09, 11 August 2015