diff --git a/scripts/definitions.js b/scripts/definitions.js index ecb384f..73f61ac 100644 --- a/scripts/definitions.js +++ b/scripts/definitions.js @@ -235,6 +235,10 @@ document.body.appendChild(tooltip); }; + var smoothScrollTo = function (anchor) { + console.log(anchor, anchor.scrollTop, anchor.hash); + }; + var article = $('section > article'); $(article, 'dfn') @@ -263,6 +267,10 @@ anchor.addEventListener('mouseout', function (event) { hideTooltip(); }); + anchor.addEventListener('click', function (event) { + event.preventDefault(); + smoothScrollTo(anchor); + }); range.surroundContents(anchor); }); });