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

Line 14: Line 14:
 
       var id = a.attributes["href"].nodeValue;
 
       var id = a.attributes["href"].nodeValue;
 
       var ele = document.getElementById(id.slice(1, id.length))
 
       var ele = document.getElementById(id.slice(1, id.length))
 +
      console.log(id, ele)
 
       var top = ele.offsetTop
 
       var top = ele.offsetTop
 
       scrollTo(0, top-20);  
 
       scrollTo(0, top-20);  

Revision as of 01:47, 17 August 2015