Difference between revisions of "Template:SJTU-BioX-Shanghai/Alpha/Header"
Line 9: | Line 9: | ||
$('#toc ul a').click( | $('#toc ul a').click( | ||
function(evnt){ | function(evnt){ | ||
− | + | var ele = $("#" + evnt.target.parentElement.href); | |
− | scrollTo(0, | + | console.log(ele, ele.offset().top); |
+ | scrollTo(0, ele.offset().top - 20); | ||
evnt.preventDefault(); | evnt.preventDefault(); | ||
} | } |
Revision as of 15:07, 16 August 2015