jQuery: animated, continuous loop through children

与世无争的帅哥 提交于 2019-12-05 02:50:00

Here's my remix: http://jsfiddle.net/ddrace/DJuV7/1/

I rearranged some things to make it more understandable and added settings for the pause and animation to keep it DRY and easier to tweak.

Does this look ok http://jsfiddle.net/Xmk2y/5/

I removed the delay , set i = 0 and swapped top values.

http://jsfiddle.net/Quincy/Xmk2y/8/

Just using the complete callback to recursively invoke nextQuote

It seems there were a few issues according to what you had mentioned. First was setting the index to -1. That seemed to cause the display all issue. Next was the animations, i have updated it to use jquery promises to ensure that the animation of the previous was finished.

End result: http://jsfiddle.net/bfbuS/2/

jQuery Promise: http://api.jquery.com/promise/

Well, this works too: http://jsfiddle.net/Xmk2y/7/. But I think I like Birey's solution better.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!