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

JavaScript Using jQuery Plugins Introducing jQuery Plugins Exploring Plugin Options

Eric Jusic
Eric Jusic
4,350 Points

How this plugin works in terms of speed

For example if we set in duration and out duration that is combined less then it needs for actual page to load, is there some callback inside a plugin that will prolong it accordingly or? Is it possible to set the animation to last as the actual page load?

4 Answers

Steven Parker
Steven Parker
231,248 Points

You wouldn't be prolonging the page load, but just displaying an animation once it was loaded.

If you wanted to display an animation during loading, you'd need to first load the minimal resources needed to perform the animation, then begin the animation while other page elements (which are not needed for the animation) are loaded by an asynchronous mechanism such as AJAX.

Steven Parker
Steven Parker
231,248 Points

As I understand it, the page loading must be complete for you to have resources available to begin the animation.

I don't think you can perform the animation during the actual page load.

Eric Jusic
Eric Jusic
4,350 Points

Thank you, Steven, for the answer. Does this mean if I set the animation to be 1000ms, that my total page time would be (time necessary for the browser to download the page) + 1000ms to perform the effect? Wouldn't that be unnecessary bloat to page load time? Meaning is that effect prolonging page load time by adding animation time?

Eric Jusic
Eric Jusic
4,350 Points

Thank you Steven for clarifying this topic to me :)