Page 1 of 1

Preinitialize pgAnimateCSS() to eliminate first use delay

PostPosted: Tue Aug 05, 2014 6:26 am
by Clifton
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.

Re: Preinitialize pgAnimateCSS() to eliminate first use dela

PostPosted: Fri Aug 28, 2015 4:33 pm
by Clifton
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.