Skip to content

Commit

Permalink
Smooth scrolling (WIP) #16
Browse files Browse the repository at this point in the history
  • Loading branch information
sebdeckers committed Nov 22, 2013
1 parent e556442 commit ff7bfac
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -263,6 +267,10 @@
anchor.addEventListener('mouseout', function (event) {
hideTooltip();
});
anchor.addEventListener('click', function (event) {
event.preventDefault();
smoothScrollTo(anchor);
});
range.surroundContents(anchor);
});
});
Expand Down

0 comments on commit ff7bfac

Please sign in to comment.