Difference between revisions of "Template:SJTU-BioX-Shanghai/Alpha/Header"
Line 9: | Line 9: | ||
$('#toc span.toctext').click( | $('#toc span.toctext').click( | ||
function(evnt){ | function(evnt){ | ||
+ | evnt.preventDefault(); | ||
+ | |||
var a = evnt.target.parentElement; | var a = evnt.target.parentElement; | ||
var id = a.attributes["href"].nodeValue; | var id = a.attributes["href"].nodeValue; | ||
Line 14: | Line 16: | ||
var top = ele.offsetTop | var top = ele.offsetTop | ||
scrollTo(0, top-20); | scrollTo(0, top-20); | ||
− | |||
console.log(id, 'done') | console.log(id, 'done') | ||
} | } |
Revision as of 01:41, 17 August 2015