Skip to content

Instantly share code, notes, and snippets.

Created June 26, 2013 21:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/5872090 to your computer and use it in GitHub Desktop.
Save anonymous/5872090 to your computer and use it in GitHub Desktop.
Javascript to build a scrollable, fixed-height, list menu.
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