Difference between revisions of "Team:Cambridge-JIC"
Line 36: | Line 36: | ||
$(this).on("click", function(){ | $(this).on("click", function(){ | ||
console.log($(this).parents("section").next().offset().top) | console.log($(this).parents("section").next().offset().top) | ||
− | $("html, body").animate({ scrollTop: $(this).parents("section").next().offset().top }, 1000); | + | $("html, body").animate({ scrollTop: $(this).parents("section").next().offset().top-250 }, 1000); |
}) | }) | ||
$(this).css("cursor", "pointer") | $(this).css("cursor", "pointer") | ||
Line 56: | Line 56: | ||
lastsec = $("section:last-of-type").prev("section"); | lastsec = $("section:last-of-type").prev("section"); | ||
− | if($(window).height() > lastsec.offset().top + lastsec.height()-10) { | + | if($(window).height() > lastsec.offset().top + lastsec.height()-10) {$("#sidebar").hide()} else {$("#sidebar").show()} |
}).resize(); | }).resize(); |
Revision as of 16:11, 4 August 2015