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.attributes["href"].nodeValue) | |
− | + | ||
− | + | ||
− | var ele = $( | + | |
console.log(ele, ele.offset().top); | console.log(ele, ele.offset().top); | ||
scrollTo(0, ele.offset().top-40); | scrollTo(0, ele.offset().top-40); |
Revision as of 15:21, 16 August 2015