Preinitialize pgAnimateCSS() to eliminate first use delay

Help for using specific functions

Preinitialize pgAnimateCSS() to eliminate first use delay

Postby Clifton » Tue Aug 05, 2014 6:26 am

In order to improve performance, some functions do not actually load their resources until they are actually needed. The function pgAnimateCSS() is one of these functions. The CSS animation libraries are not actually loaded onto the current page until they are actually used by executing the function. The downside of this is that the function may seem to have an unexpected delay the first time it is invoked.

To fix this, simply execute pgAnimateCSS() on load page without setting any parameters. The effect is that the function will load up its dependencies into the browser cache. They will then be instantly available whenever the function is executed with the tbName parameter set to animate a specific object.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Preinitialize pgAnimateCSS() to eliminate first use dela

Postby Clifton » Fri Aug 28, 2015 4:33 pm

While this can still be done, this is no longer necessary as the PowerPac has built in routines to make sure the css files are initialized before styles are applied to objects.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to Function Help

Who is online

Users browsing this forum: No registered users and 3 guests

cron