Skip to content

Instantly share code, notes, and snippets.

@harmstyler
Forked from anonymous/enablescrollmenu.coffee
Created June 26, 2013 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harmstyler/5872103 to your computer and use it in GitHub Desktop.
Save harmstyler/5872103 to your computer and use it in GitHub Desktop.
enableScrollMenu = ->
$(".bottomscrollbar").hover (->
$this = $(this)
windowHeight = $this.prev().children().length * $this.prev().children().height()
$this.prev().animate(
scrollTop:windowHeight
,600)
), ->
# stop on unhover
$(this).prev().stop()
$(".topscrollbar").hover (->
$this = $(this)
$this.next().animate(
scrollTop: 0
,600)
), ->
# stop on unhover
$(this).next().stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment