Skip to content

Instantly share code, notes, and snippets.

View smokinjoe's full-sized avatar

Joe smokinjoe

View GitHub Profile
@smokinjoe
smokinjoe / anchor_smooth_scroll.js
Created January 26, 2016 18:20 — forked from justinmc/anchor_smooth_scroll.js
Anchor Smooth Scroll - Angular Directive
/**~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Anchor Smooth Scroll - Smooth scroll to the given anchor on click
* adapted from this stackoverflow answer: http://stackoverflow.com/a/21918502/257494
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
angular.module('yourapp').directive('anchorSmoothScroll', function($location) {
'use strict';
return {
restrict: 'A',
replace: false,