Skip to content

Instantly share code, notes, and snippets.

@gdotdesign
Created August 29, 2011 06:10
Show Gist options
  • Save gdotdesign/1177864 to your computer and use it in GitHub Desktop.
Save gdotdesign/1177864 to your computer and use it in GitHub Desktop.
SmoothScroll alternate version #MooTools
window.addEvent "domready", ->
scroll = new Fx.Scroll($("content"))
$$("a[href^=#]").addEvent 'click', (e)->
e.stop()
el = $$("a[name=#{@get('href')[1..]}]")[0]
scroll.toElement(el).chain -> window.location.hash = "#"+name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment