Add $.fn.scrollUp and .scrollDown

These scroll the element by a small amount up or down.
This commit is contained in:
Corey Johnson & Nathan Sobo
2013-03-11 17:31:17 -06:00
parent 140b22737e
commit 7e03880bd0
2 changed files with 36 additions and 0 deletions

View File

@@ -7,6 +7,12 @@ $.fn.scrollBottom = (newValue) ->
else
@scrollTop() + @height()
$.fn.scrollDown = ->
@scrollTop(@scrollTop() + $(window).height() / 20)
$.fn.scrollUp = ->
@scrollTop(@scrollTop() - $(window).height() / 20)
$.fn.scrollToTop = ->
@scrollTop(0)