Difference between revisions of "Template:SJTU-BioX-Shanghai/Alpha/Header"
Line 13: | Line 13: | ||
var ele = document.getElementById(id.slice(1, id.length)) | var ele = document.getElementById(id.slice(1, id.length)) | ||
var top = ele.offsetTop | var top = ele.offsetTop | ||
− | + | scrollTo(0, top-20); | |
− | scrollTo(0, top- | + | |
evnt.preventDefault(); | evnt.preventDefault(); | ||
+ | console.log(id, 'done') | ||
} | } | ||
) | ) |
Revision as of 01:38, 17 August 2015