Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Matt Van Dyck
2,033 PointsJavascript Load when Scrolled to?
Hi there. I was wondering how to delay the loading of a javascript code to achieve the effect here: http://builtbybuffalo.com/ - I am referring to the part when you scroll down, you see the circle graphs loading sequentially. How can you delay the loading of your javascript code so that the user can see those graphs fill up when scrolled to?
Thanks
1 Answer
Andrei-Robert Rusu
763 PointsI don't know how they did it, but it's fairly simple. Just take a look at the jQuery Scroll Event http://api.jquery.com/scroll/
var screenTop = $(document).scrollTop();
Will give you the current height scrolled from top to bottom.
You just have to use these 2 and a few others things to achieve what you want.
Good luck