Skip to content

Instantly share code, notes, and snippets.

@harmstyler
Forked from anonymous/enablescrollmenu.coffee
Created June 26, 2013 21:54
Show Gist options
  • 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