Last active
December 13, 2015 23:59
-
-
Save taea/4995866 to your computer and use it in GitHub Desktop.
listが一定間隔でスクロールしてくるくる回るやつ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ -> | |
targetUl = "ul#autoScroll" | |
targetList = "ul#autoScroll li" | |
targetListHeight = $(targetList).height() | |
delayTime = 4000 | |
scrollDistance = (-1 * targetListHeight) + 'px' | |
setInterval (-> | |
$(targetUl).find("li:first").appendTo(targetUl).show() | |
$(targetUl).find("li:first").hide -> | |
$(this).animate {'top': scrollDistance}, "slow", -> | |
$(this).find("li:last").show() | |
), delayTime |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment