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- | + | $("html, body").animate({ scrollTop: $(this).parents("section").next().offset().top-70 }, 1000); |
}) | }) | ||
$(this).css("cursor", "pointer") | $(this).css("cursor", "pointer") | ||
Line 93: | Line 93: | ||
function scrollsection(id) { | function scrollsection(id) { | ||
− | $("html, body").animate({ scrollTop: $($("section").get(id)).offset().top- | + | $("html, body").animate({ scrollTop: $($("section").get(id)).offset().top-70 }, 1000); |
} | } | ||
</script> | </script> |
Revision as of 21:59, 4 August 2015