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){ | ||
− | + | var a = evnt.target.parentElement; | |
− | var ele = $( | + | console.log(a, a.attributes["href"].nodeValue) |
− | console.log(ele, ele.offset().top); | + | var ele = $(a.attributes["href"].nodeValue) |
+ | console.log(ele[0], ele.offset().top); | ||
scrollTo(0, ele.offset().top-40); | scrollTo(0, ele.offset().top-40); | ||
evnt.preventDefault(); | evnt.preventDefault(); |
Revision as of 01:30, 17 August 2015